Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stop mode:fixup support since v0.14_05 #72

Merged
merged 1 commit into from
Jul 21, 2012
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 4 additions & 45 deletions lib/Teng.pm
Original file line number Diff line number Diff line change
Expand Up @@ -228,19 +228,7 @@ sub _execute {
eval { $sth = $self->__execute($sql, $binds) };

if ($@) {
if ( $self->mode eq 'fixup' ) {
if ( $self->connected ) {
$self->handle_error($sql, $binds, $@);
}
$self->reconnect;
eval { $sth = $self->__execute($sql, $binds) };
if ($@) {
$self->handle_error($sql, $binds, $@);
}
}
else {
$self->handle_error($sql, $binds, $@);
}
$self->handle_error($sql, $binds, $@);
}

return $sth;
Expand Down Expand Up @@ -439,38 +427,13 @@ sub txn_scope {
my $self = shift;
my @caller = caller();

my $scope;
if ( $self->mode eq 'fixup' ) {
eval { $scope = $self->txn_manager->txn_scope(caller => \@caller) };
if ( $@ ) {
if ( $self->connected ) {
die $@;
}
$self->reconnect;
$scope = $self->txn_manager->txn_scope(caller => \@caller);
}
}
else {
$scope = $self->txn_manager->txn_scope(caller => \@caller);
}
return $scope;
$self->txn_manager->txn_scope(caller => \@caller);
}

sub txn_begin {
my $self = shift;
if ( $self->mode eq 'fixup' ) {
eval { $self->txn_manager->txn_begin };
if ( $@ ) {
if ( $self->connected ) {
die $@;
}
$self->reconnect;
$self->txn_manager->txn_begin;
}
}
else {
$self->txn_manager->txn_begin;
}

$self->txn_manager->txn_begin;
}
sub txn_rollback { $_[0]->txn_manager->txn_rollback }
sub txn_commit { $_[0]->txn_manager->txn_commit }
Expand Down Expand Up @@ -760,10 +723,6 @@ Specifies the database handle to use.

reconnect at dbh->ping fail each execute.

=item * C<fixup>

reconnect at fail execute.

=item * C<no_ping>

no auto reconnect.
Expand Down
162 changes: 0 additions & 162 deletions t/001_basic/031_reconnect_fixup.t

This file was deleted.