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

Andrew Bartlett abartlet at samba.org
Fri Dec 23 23:20:51 GMT 2005


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

-- 
Andrew Bartlett                                http://samba.org/~abartlet/
Authentication Developer, Samba Team           http://samba.org
Student Network Administrator, Hawker College  http://hawkerc.net
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://lists.samba.org/archive/samba-technical/attachments/20051224/1b4f09d6/attachment.bin


More information about the samba-technical mailing list