Hello,
Looks like there is a typo (that wreaked havoc on my code !)
Ought to be:
sub MakeAllDBHsForkSafe { my %drivers = DBI->installed_drivers; foreach my $drh (values %drivers) { map { $_->{InactiveDestroy} = 1 } @{$drh->{ChildHandles}}; } }
Instead of:
sub MakeAllDBHsForkSafe { my %drivers = DBI->installed_drivers; foreach my $drh (values %drivers) { map { $_->{InactiveDestroy} = 1 } @{$_->{ChildHandles}}; } }
Then, I would go for some code a bit more cautious :
sub MakeAllDBHsForkSafe { my %drivers = DBI->installed_drivers; foreach my $drh (values %drivers) { $_->{InactiveDestroy} = 1 for (grep {defined} @{$drh->{ChildHand +les}}); } }
In reply to Re: Fork-safe DBI handles via ChildHandles and InactiveDestroy
by TVNshack
in thread Fork-safe DBI handles via ChildHandles and InactiveDestroy
by etcshadow
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |