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

"Edward J. Sabol" <sabol-2oVx0MVsMgiP/[email protected]>
Newsgroups gmane.comp.lang.perl.modules.class-dbi
Message-ID <[email protected]>
> 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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.