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

David Collier-Brown David.Collier-Brown at Sun.COM
Sat Dec 24 00:08:20 GMT 2005


   Maybe a transactional_ldb_whatever() call, with an implicit
abort if you don't explicitly call commit??

--dave

Andrew Bartlett wrote:
> On Fri, 2005-12-23 at 17:06 +1100, tridge at samba.org wrote:
> 
>>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.
> 
> 
> I'm just worried that I've been unable to write a bug-free use of the
> transaction API, because I still haven't handled cancelling it in every
> last error path.
> 
> Andrew Bartlett
> 

-- 
David Collier-Brown,      | Always do right. This will gratify
Sun Microsystems, Toronto | some people and astonish the rest
davecb at canada.sun.com     |                      -- Mark Twain
(416) 263-5733 (x65733)   |


More information about the samba-technical mailing list