Len Jaffe wrote:

> Do you mean that when I use DBIC, AutoCommit isn't used to set the
> underlying DB's autocommit setting?

Now I've read the DBI docs, and a little Schema.pm source, I see that
AutoCommit is in fact a DBI attribute, and connect/connection passes it
straight down to DBI. It sounds from what others here have said that
DBIx::Class sniffs it to alter its own behaviour slightly too.

> When I set AutoCommit, I expect every C,U, & D operation to commit
> without
> my intervention, 

Yes it does. And you can still use txn_begin/txn_commit explicitely to
make larger transactions.

> and when I unset AutoCommit, I expect to have to
> begin/commit all of my own transactions.  

You do. Either with the DBIx::Class txn_commit, or the lower level API.

In my case (with SQLite) it seems that I MUST use the DBI API to avoid
my final error message; txn_commit commited my transaction, but
DBD::SQLite complained when I exit my app without calling disconnect.

> I find I need to do my own TX
> control when I am, for example, turning a shopping cart into an order,
> which
> tends to need to be atomic across inserts into several tables.

Well, you could still do that and have AutoUpdate=>1, which I'll just
use forever now out of superstition, because I don't understand DBI and
I don't like error messages.

Steven


_______________________________________________
List: http://lists.rawmode.org/cgi-bin/mailman/listinfo/dbix-class
Wiki: http://dbix-class.shadowcatsystems.co.uk/
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/trunk/DBIx-Class/
Searchable Archive: http://www.mail-archive.com/[email protected]/

Reply via email to