tdb question

Jeremy Allison jra at
Thu Jan 31 23:01:06 GMT 2008

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 need the old processes to see the new db "under
construction" as it were, then just write out a new tdb, delete
the old file and signal the old processes to switch over.


More information about the samba-technical mailing list