=head1 SEE ALSO
-=over 4
+=head2 L<DBIx::Class::Core> - DBIC Core Classes
-=item L<DBIx::Class::Core> - DBIC Core Classes
+=head2 L<DBIx::Class::CDBICompat> - L<Class::DBI> Compat layer.
-=item L<DBIx::Class::CDBICompat> - L<Class::DBI> Compat layer.
-
-=item L<DBIx::Class::Manual> - User's manual.
-
-=back
+=head2 L<DBIx::Class::Manual> - User's manual.
=head1 AUTHOR
=cut
-sub tx_commit { $_[0]->storage->tx_begin }
+sub tx_begin { $_[0]->storage->tx_begin }
=head2 tx_commit
=cut
sub tx_commit {
- $_[0]->dbh->commit if --$TRANSACTION == 0;
+ if ($TRANSACTION == 0) {
+ $_[0]->dbh->commit;
+ }
+ else {
+ $_[0]->dbh->commit if --$TRANSACTION == 0;
+ }
}
=head2 tx_rollback
=cut
sub tx_rollback {
- --$TRANSACTION == 0 ? $_[0]->dbh->rollback : die $@;
+ if ($TRANSACTION == 0) {
+ $_[0]->dbh->rollback;
+ }
+ else {
+ --$TRANSACTION == 0 ? $_[0]->dbh->rollback : die $@;
+ }
}
sub _execute {