Subject: | About the sub do_transaction in the pod |
sub do_transaction {
my $class = shift;
my ( $code ) = @_;
local $class->db_Main->{ AutoCommit };
eval { $code->() };
if ( $@ ) {
my $commit_error = $@;
eval { $class->dbi_rollback }; # might also die!
die $commit_error;
}
}
I tried that sub using postgresql, and it lacks a $class->dbi_commit; at the end, without it, the autocommit magic comes back to true when the blocks exits and the transaction is rolled back.