but if they execute that END block when they exit...
They do. Even without the END block, the problem would still exists since the child would call $dbh's destructor which calls disconnect (after issuing a warning).
Sorry, I don't have any good solution short of connecting after the fork. Maybe you can create a pool of reusable children early on? Maybe you can exec within the child, even if only to relaunch Perl? Maybe you can add to a job list which monitored by cron job instead of forking?
In reply to Re^3: Preventing database handles from going stale
by ikegami
in thread Preventing database handles from going stale
by dsheroh
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |