in reply to Re^2: Preventing database handles from going stale
in thread Preventing database handles from going stale

Have the child set $dbh->{InactiveDestroy} = 1; and then undef the $dbh. That should keep it from disconnecting the parent's connection. After that, you'll just have to fix the END block so it doesn't try to call disconnect on an undefined value.

END { $dbh->disconnect if $dbh; }

I wrote about this and more in DBI, fork, and clone..

Replies are listed 'Best First'.
Re^4: Preventing database handles from going stale
by dsheroh (Monsignor) on Feb 06, 2007 at 01:35 UTC
    Excellent suggestion and some good info in your linked writeup, too. Thanks!