DBIx-RetryOverDisconnects
view release on metacpan or search on metacpan
lib/DBIx/RetryOverDisconnects.pm view on Meta::CPAN
$new_self->{PRIV()} = {%$data};
return $new_self;
}
=head1 Database handle object methods
=head2 set_callback
$dbh->set_callback(afterReconnect => $code_ref);
Set callbacks for some events. Currently only afterReconnect is supported.
It is called after every successful reconnect to database.
=cut
sub set_callback {
my ($self, %callbacks) = @_;
my $old = $self->{PRIV()}->{callback} || {};
$self->{PRIV()}->{callback} = {%$old, %callbacks};
return;
}
sub exc_conn_trans {
my $self = shift;
my $msg = 'Connection to database lost while in transaction';
$DBIx::RetryOverDisconnects::errstr = $msg;
$DBIx::RetryOverDisconnects::err = 3;
DBIx::RetryOverDisconnects::Exception->new($msg);
}
( run in 1.594 second using v1.01-cache-2.11-cpan-9b1e4054eb1 )