directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Emmanuel Lecharny <>
Subject Re: Storing the txn nto each operationContext
Date Sun, 25 Dec 2011 18:53:54 GMT
On 12/25/11 7:08 PM, Emmanuel L├ęcharny wrote:
> On 12/25/11 5:58 PM, Selcuk AYA wrote:
>> On Sun, Dec 25, 2011 at 5:37 PM, Emmanuel 
>> Lecharny<>  wrote:
>>> In order to implement that, we need to add one thing :
>>> - a nbRef in readOnly transactions, which will be incremented and
>>> decremented as soon as we add new RO txns or abort/commit txns
>>> Is that enough ?
>> this is also a reply to you previous email.
>> I suggest we use a txn per operation but we do not have to store the
>> txn context pointer in operation context. We can still have the thread
>> context stored in thread local variable but we also store a TxnHandle
>> ref in EntryFilteringCursor. And we do something like this:
>> next()
>> {
>>    get txn handle stored in the cursor and set it as the thread local 
>> variable.
>> do the next
>> unset the thread local variable.
>> }
> In fact, as each operation except Search are atomic, I don't know if 
> it's useful to store the txn in the thread local variable. Regarding 
> the search, we just have to store the txn in the cursor, so we don't 
> have to store it into the thread local variable either.

FYI, ATM, I will keep the txn in the thread local variable. Premature 
optimization blah blah, etc. You know what I'm talking about :)

Emmanuel L├ęcharny

View raw message