From: Peter Rabbitson Date: Tue, 5 Aug 2014 12:37:28 +0000 (+0200) Subject: Tighten the 'txn-op on disconnected handle' checks X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=d4702d539ce9d9d19868a0709576264c3b72afdd;p=dbsrgits%2FDBIx-Class-Historic.git Tighten the 'txn-op on disconnected handle' checks --- diff --git a/lib/DBIx/Class/Storage/DBI.pm b/lib/DBIx/Class/Storage/DBI.pm index b556728..afa07c5 100644 --- a/lib/DBIx/Class/Storage/DBI.pm +++ b/lib/DBIx/Class/Storage/DBI.pm @@ -1550,9 +1550,8 @@ sub _exec_txn_begin { sub txn_commit { my $self = shift; - $self->_verify_pid unless DBIx::Class::_ENV_::BROKEN_FORK; $self->throw_exception("Unable to txn_commit() on a disconnected storage") - unless $self->_dbh; + unless $self->_seems_connected; # esoteric case for folks using external $dbh handles if (! $self->transaction_depth and ! $self->_dbh->FETCH('AutoCommit') ) { @@ -1581,9 +1580,8 @@ sub _exec_txn_commit { sub txn_rollback { my $self = shift; - $self->_verify_pid unless DBIx::Class::_ENV_::BROKEN_FORK; $self->throw_exception("Unable to txn_rollback() on a disconnected storage") - unless $self->_dbh; + unless $self->_seems_connected; # esoteric case for folks using external $dbh handles if (! $self->transaction_depth and ! $self->_dbh->FETCH('AutoCommit') ) { @@ -1611,9 +1609,8 @@ sub _exec_txn_rollback { # generate the DBI-specific stubs, which then fallback to ::Storage proper quote_sub __PACKAGE__ . "::$_" => sprintf (<<'EOS', $_) for qw(svp_begin svp_release svp_rollback); - $_[0]->_verify_pid unless DBIx::Class::_ENV_::BROKEN_FORK; $_[0]->throw_exception('Unable to %s() on a disconnected storage') - unless $_[0]->_dbh; + unless $_[0]->_seems_connected; shift->next::method(@_); EOS