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

Darren Duncan darren at DarrenDuncan.net
Sat Oct 20 19:31:31 GMT 2007


At 10:43 AM +0200 10/20/07, Jesper Krogh wrote:
>It was my impression that passing AutoCommit => 1 goes directly to the
>$dbh (correct me if I'm wrong?)
>
>And that AutoCommit => 1 makes every UPDATE/INSERT/DELETE in the
>database, to work as a single entity (correct me if I'm wrong here?)

Each individual SQL statement is conceptually supposed to be atomic, 
like it was an implicit transaction, regardless of the presense of 
any explicit transactions, so a failing single statement should never 
leave an inconsistent database.  In actuality, some DBMSs claim to do 
this (even MySQL?), and others not necessarily.  Explicit 
transactions are mainly to make a succession of multiple SQL 
statements collectively atomic.

But regardless, if there is a concern that an individual SQL 
statement isn't atomic, then autocommit should still equal 1, and an 
explicit transaction, eg with txn_do, should be wrapped around the 
single statement, in order to "make sure".

-- Darren Duncan



More information about the DBIx-Class mailing list