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

Steven Mackenzie dbix at aptile.co.uk
Wed Oct 4 10:57:47 CEST 2006


Brandon Black wrote:

> On 10/3/06, Steven Mackenzie <dbix at aptile.co.uk> wrote:
>
>> I'm running a script to patch an error in my database. It loops over
>> each bad row and fixes it, and works fine, except that it requires me to
>> have
>> $data->storage->disconnect();
>> at the end of it, otherwise I get this message:
>> Issuing rollback() for database handle being DESTROY'd without explicit
>> disconnect().
>
> Try setting AutoCommit => 1 instead of 0, I think your code will work
> correctly and it might get rid of that message.  IIRC DBIC's transaction
> support doesn't depend on the state of AutoCommit, and AutoCommit => 1
> will
> generally give you more "expected" behavior.
>
> -- Brandon

Yes, AutoCommit=>1 lets my script work without the
$data->storage->disconnect(), and the txn_begin/txn_commit work as
intended, thanks.

AutoCommit=>0 exits with a rollback whether or not I use the txn_* methods.

Thanks!
Steven



More information about the Dbix-class mailing list