[Dbix-class] Fwd: ->storage->disconnect() Required After Using SQLite?

Steven Mackenzie dbix at aptile.co.uk
Wed Oct 4 14:33:02 CEST 2006


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




More information about the Dbix-class mailing list