Boost logo

Boost :

Subject: Re: [boost] Boost library submission (poll for interest)
From: Vicente Botet Escriba (vicente.botet_at_[hidden])
Date: 2010-01-15 07:50:43

Bob Walters-2 wrote:
> On Wed, Jan 13, 2010 at 7:49 PM, Brian Ravnsgaard Riis
> <brian_at_[hidden]> wrote:
>> One thing that immediately jumped at me, though, is this construct:
>>    Transaction *txn = db.beginTransaction();
>>    {
>>        ...
>>    }
>>    db.commit(txn);
>> >From an exception safety POV: What happens if db.commit(txn) is never
>> called
>> here? The raw Transaction pointer raises my hackles immediately. Blame it
>> on
>> Stroustrup and Meyers! :-) Am I missing something here?
> No. I should have at least used an auto there to ensure destruction.
> Actually the whole convention of the "database as factory" for
> transactions is something I'm going to rework so that you can have the
> transaction on the stack if you so choose. I do think I want to
> continue to support explicit transactions, but am very tempted by
> something Stefan is doing in Boost.Persistent, in which transaction
> scope is retained in thread-specific memory (I assume) and passed
> around implicitly. Support for that as an optional approach is
> something I need to do for those who prefer that.

if you can store the transaction on the stack you could use the atomic
language-like macros Stefan provides in it Persistent library.

I agree that you should support transparent as well as explicit
transactions. transparent transaction have a cost to access the thread
specific pointer.


View this message in context:
Sent from the Boost - Dev mailing list archive at

Boost list run by bdawes at, gregod at, cpdaniel at, john at