From: Brandon L. Black Date: Wed, 1 Mar 2006 05:38:51 +0000 (+0000) Subject: dbh->{InactiveDestroy} when reconnecting in child process (prevents auto-disconnectin... X-Git-Tag: v0.06000~77 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=d1b9a425a19444aebe01ee70c4b1dd334c16b825;p=dbsrgits%2FDBIx-Class.git dbh->{InactiveDestroy} when reconnecting in child process (prevents auto-disconnecting a dbh still in use by the parent) --- diff --git a/lib/DBIx/Class/Storage/DBI.pm b/lib/DBIx/Class/Storage/DBI.pm index d0024b3..28c0706 100644 --- a/lib/DBIx/Class/Storage/DBI.pm +++ b/lib/DBIx/Class/Storage/DBI.pm @@ -289,8 +289,10 @@ sub ensure_connected { sub dbh { my ($self) = @_; - $self->_dbh(undef) - if $self->_connection_pid && $self->_connection_pid != $$; + if($self->_connection_pid && $self->_connection_pid != $$) { + $self->_dbh->{InactiveDestroy} = 1; + $self->_dbh(undef) + } $self->ensure_connected; return $self->_dbh; }