[Dbix-class] ROLLBACK seems to be skipped on 0.08

Jesper Krogh jesper at krogh.cc
Mon Oct 22 17:52:16 GMT 2007


Brandon Black wrote:
> On 10/22/07, Jesper Krogh <jesper at krogh.cc> wrote:
>>> On 10/20/07, Jesper Krogh <jesper at krogh.cc> wrote:
>>> I'll work out a patch for this sometime this weekend, we'll see on IRC
>>> where it should go, as far as who it breaks, etc.
>> Let me know when there is something to test?
>>
> 
> Well, I started on this, then in thinking about it more I realized
> that the proposed solution (requiring that we're in an explicit
> transaction before allowing database statements to go through w/o
> AutoCommit) won't work in the general case either.  This is because
> most of the other CPAN DBIC code people are likely to use isn't going
> to use transactions for everything.

But they are alson likely to run with AutoCommit => 1 right?

> It's perfectly legitimate for some CPAN DBIC-related module to do an
> isolated statement with no explicit txn.  Under AutoCommit this will
> normally just work, and if you want it to be part of a larger txn,
> that works too.  But if we enforced explicit txns w/ AutoCommit off,
> then it would fail when you made some innocuous call like
> $c->user_exists (which in turn might do so magic on your User table
> underneath, and you didn't think to wrap it in an explicit DBIC txn at
> the outer layer).
> 
> So I guess what I'm saying is that forcing AutoCommit=>0 users to use
> explicit txns everywhere isn't compatible with the idea of generic
> DBIC modules/plugins and the idea of allowing AutoCommit=>1 users to
> not wrap everything in txns.
> 
> I'm still thinking...

Would it be an option to clearly mark the $storage->txn_begin/commit
stuff as deprecated and make it work "as broken" as in 0.07?

Jesper
-- 
Jesper Krogh, jesper at krogh.cc




More information about the DBIx-Class mailing list