tdb question

Herb Lewis hlewis at panasas.com
Thu Jan 31 21:03:34 GMT 2008


So is there some api call that I'm missing to delete all
entries or would I still need to do the traverse/delete
between transaction start/commit?

Volker Lendecke wrote:
> On Thu, Jan 31, 2008 at 12:40:42PM -0800, Herb Lewis wrote:
> 
>>I have a tdb opened by several processes. I want one process
>>to basically delete all the current entries and rebuild the
>>tdb with new entries. What is the best way to do this? Should
>>I just call tdb_writelock, traverse the tdb to delete all existing
>>records then store the new ones and call tdb_writeunlock, or is
>>there some better way using transactions? Will other process
>>calls to tdb_fetch block or return an error while it is locked?
> 
> 
> If you don't have too many records (i.e. at most thousands,
> not millions), a tdb transaction might be best. Then you
> can always bail out.
> 
> Volker


More information about the samba-technical mailing list