- or download this
if ($self->{_can_do_transactions}) {
local $dbh->{AutoCommit} = 0;
...
{
code_that_touches_db();
}
- or download this
if ($self->{_can_do_transactions}) {
...
{
code_that_touches_db();
}
- or download this
eval {
local $dbh->{AutoCommit} = 0;
};
$self->{_can_do_transactions} = $@ ? 0 : 1;
- or download this
# If RaiseError is false, begin_work() will:
# return true if a new transaction was started
...
};
$self->{_can_do_transactions} = $@ ? 0 : 1;
eval { $dbh->rollback } if $started_a_new_transaction;
- or download this
closing dbh with active statement handles during global destruction
- or download this
eval {
my $val = $dbh->{AutoCommit}; # makes error go away?
local $dbh->{AutoCommit} = 0;
};
$self->{_can_do_transactions} = $@ ? 0 : 1;