[CDBI] Re: Transaction over parent and children has_a objects

Edward J. Sabol sabol at alderaan.gsfc.nasa.gov
Tue Apr 4 21:59:46 BST 2006


> When i call this i get this error: DBD::mysql::db rollback failed:
> Rollback ineffective while AutoCommit is on
>
> How can AutoCommit be on there? Same thing happens if i call commit.
> The rows are inserted without problem.

When you call

        $class->dbi_rollback;

you aren't getting the same dbh as you were when the transaction was
initiated. This can happen if you override db_Main and you don't have the
following line somewhere in your class:

        __PACKAGE__->_remember_handle('Main');

Even if you did have that, a poorly coded db_Main() which doesn't return the
same dbh under normal operations could cause the same problem.

Hope this helps,
Ed




More information about the ClassDBI mailing list