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

_______________________________________________
List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
Searchable Archive: http://www.grokbase.com/group/[EMAIL PROTECTED]

Reply via email to