my $t = Transaction->new($dbh); $t->transaction(sub { for (1..10) { my $sth = $dbh->prepare(...); $sth->execute() or $t->rollback; } }); #### transaction_select $dbh; transaction { for (1..10) { my $sth = $dbh->prepare(...); $sth->execute() or rollback; } };