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

"Peter Speltz" <[email protected]>
Newsgroups gmane.comp.lang.perl.modules.class-dbi
Message-ID <[email protected]>
I'm having trouble with transactions in CDBI 3.14  with mysql 4.1 .
All tables are InnoDB.
Here is my test sub:

 sub test_trans {

    my ($class) = @_;
    my $cdata = { cstmr_type => 'Residential', old_id => -1 };
    my $contact_data = { first_name => 'TEST_TRANS', 'last_name' =>
"WORK I HOPE", label => 'Testtrans'};
    my $obj;

    { # start
        local $class->db_Main->{ AutoCommit };
        $obj = $class->insert($cdata);
        $obj->add_to_contacts($contact_data);

        $class->dbi_rollback;
        #$class->dbi_commit;  # same type error
    } # end
}

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.

thanks for any help.
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.