dbh->{InactiveDestroy} when reconnecting in child process (prevents auto-disconnectin...
Brandon L. Black [Wed, 1 Mar 2006 05:38:51 +0000 (05:38 +0000)]
lib/DBIx/Class/Storage/DBI.pm

index d0024b3..28c0706 100644 (file)
@@ -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;
 }