svn commit: samba r12432 - in branches/SAMBA_4_0/source/rpc_server/samr: .

tridge at samba.org tridge at samba.org
Fri Dec 23 06:06:33 GMT 2005


catching up on email ....

Andrew,

 > > Isn't that a classical case for a talloc destructor?
 > 
 > Indeed, and it raises a good point.  
 > 
 > I think the ldb_transaction call should take a talloc context, on which
 > is should add it's own internal destructor.  While a transaction is
 > rolled back on database close, in this case that would be too long.

The reason it wasn't done that way is that the transaction is a
property of the process/database pair. You can't have two transactions
going at the same time in the same process on the same
database. Returning a handle from ldb_transaction_start() might imply
to callers that they can have multiple of these handles active at
once.

Then there is the problem of differentiating between commit and
cancel. The destructor wouldn't be told which you want. I guess we
could assume cancel and auto-free the handle on commit, but it seems a
rather awkward api.

Cheers, Tridge


More information about the samba-technical mailing list