Subject: | txn_do doesn't rollback after last retry |
The following program does no rollback after a SQL exception :
use DBIx::RetryOverDisconnects;
my $dbh = DBIx::RetryOverDisconnects->connect(
'dbi:SQLite:dbname=:memory:', '', '',
{RaiseError => 1,
TxnRetries => 1}
);
my $transaction = sub {
$dbh->do('INSERT INTO foobar(col) VALUES (123)');
};
$dbh->txn_do($transaction);
This is because txn_do throws an exception at the last retry, without
checking properly if the error was an SQL error or connection error.