| DBIx-Transaction documentation | Contained in the DBIx-Transaction distribution. |
DBIx::Transaction::st - Statement handle when running under DBIx::Transaction
When you connect to a database using DBIx::Transaction, your statement handles
will be DBIx::Transaction::st objects. When these statement handles are
executed, DBIx::Transaction::st will notice when query errors occur, and
let the database handle know. See
the commit() method in DBIx::Transaction::db
for more information.
DBIx::Transaction::st only overrides one standard DBI::st method:
Calls execute on the underlying database layer. If an error
occurs, this is recorded and you will not be able to issue a commit
for the current transaction.
| DBIx-Transaction documentation | Contained in the DBIx-Transaction distribution. |
package DBIx::Transaction::st; use DBI; use base q(DBI::st); use strict; use warnings (FATAL => 'all'); use Carp qw(croak); return 1; sub execute { my $self = shift; my $rv = eval { DBI::st::execute($self, @_); }; if($@) { $self->{Database}->inc_transaction_error(caller, $self->errstr); croak "$@\n"; } if(!$rv) { $self->{Database}->inc_transaction_error(caller, $self->errstr); } return $rv; }