Boost logo

Boost :

Subject: Re: [boost] Boost library submission (poll for interest)
From: Bob Walters (bob.s.walters_at_[hidden])
Date: 2010-01-14 23:06:24


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.

> Consider me interested! :-)

Thanks. I'm going through a rewrite of some of the checkpoint logic.
Once that's confirmed as working, there should be a tarball available.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk