Darren Duncan wrote: > 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".
Ok.. maybe I didnt make it clear. The problem is that we "serialize" object into several records (over 20 mostly) and this serialization process should be done atomically, so I don't get any "half-objects" in the database. It wasn't the individual record I was talking about. This dataset is conceptually "inconsistent" to the application if this happens. But the database is of course not aware of this. txn_begin/commit and txn_do solves this. Jesper -- Jesper Krogh, [EMAIL PROTECTED] _______________________________________________ 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]
