This ensures that a failed rollback won't leave is in a weird state
# in order to unambiguously reset the state - do the cleanup in guard
my $g = scope_guard {
+
+ {
+ local $@ if DBIx::Class::_ENV_::UNSTABLE_DOLLARAT;
+ eval { $self->_dbh->disconnect };
+ }
+
$self->_dbh(undef);
$self->_dbh_details({});
$self->transaction_depth(undef);
#$self->_sql_maker(undef); # this may also end up being different
};
- if( my $dbh = $self->_dbh ) {
+ if( $self->_dbh ) {
$self->_do_connection_actions(disconnect_call_ => $_) for (
( $self->on_disconnect_call || () ),
# stops the "implicit rollback on disconnect" warning
$self->_exec_txn_rollback unless $self->_dbh_autocommit;
-
- $dbh->disconnect;
}
}