Locking database cleanup?

tridge at samba.org tridge at samba.org
Thu Apr 6 07:29:46 GMT 2006


 > Are normal tdb writes covered by transactions now, if only
 > for their internal stuff, or would we have to encapsulate
 > every write with a start/commit transaction?

you'd have to wrap them in start/commit transaction.

The reason it works that way is that the tdb API doesn't tell tdb how
to group the operations together. So if we just made each operation a
transaction, and you are updating two records which have some mutual
dependence, then when it rolls back you won't have a corrupt database,
but you will have an inconsistent one.

For many of the simpler databases in Samba this doesn't matter, but
for some it does.

Cheers, Tridge

More information about the samba-technical mailing list