[Dbix-class] transactions, etc.

Brandon Black blblack at gmail.com
Wed Jan 24 18:22:49 GMT 2007


On 1/24/07, Josef Karthauser <joe at tao.org.uk> wrote:
> On Wed, Jan 24, 2007 at 10:26:08AM -0600, Brandon Black wrote:
> >
> > The current development branch has re-worked this, I think your
> > comments are based on the released 0.07 stuff.  In the dev branch, the
> > recommended txn_do style handles reconnects correctly, but I don't
> > think manually using txn_begin/txn_end offer explicit guarantees in
> > some corner cases (like, if you started a transaction, did a few
> > things successfully, then lost your connection in mid-transaction -
> > but that would be rare assuming you're not holding transactions open
> > for long periods, which you shouldn't - but in any case what will
> > happen is you'd lose the top half of the transaction, but carry on
> > trying to execute the rest of it (and probably fail there for
> > referential integrity reasons in many cases)).
> >
>
> Nope, I'm talking about the -current branch.  I think that the code when
> it reconnections should check to see whether the internal transaction
> count is non-zero, and if it raise an exception instead of proceeding.
> That would be the safest thing to do.
>

In the txn_begin/txn_end case that's true, although it needs some
careful thought and testing.  However, txn_do is much more robust, and
I don't believe it currently suffers from this problem.



More information about the Dbix-class mailing list