To test if rollback is supported, set $dbh->{AutoCommit} to 0, then read it again; if it's still 0, then you have transactions.
You should have the entire transaction - from when you turned autocommit off / issued a START TRANSACTION command (ok, $dbi->begin_work() :-)) to where you call $dbi->commit() - inside one big eval(), and replay the block if it fails, say, up to three times - to help it stumble along in the case of high concurrency / locking issues.
This might be RDBMS dependant, but you don't have to issue a ->rollback() if the commit() failed; that is implicit. ->rollback() is for when you change your mind about the query halfway through.
$h=$ENV{HOME};my@q=split/\n\n/,`cat $h/.quotes`;$s="$h/." ."signature";$t=`cat $s`;print$t,"\n",$q[rand($#q)],"\n";
In reply to Re: perl-mysql question - rollback...
by mugwumpjism
in thread perl-mysql question - rollback...
by kiat
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |