Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Fork-safe DBI handles via ChildHandles and InactiveDestroy

by TVNshack (Novice)
on Jul 03, 2015 at 12:08 UTC ( [id://1133086]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    sub MakeAllDBHsForkSafe {
        my %drivers = DBI->installed_drivers;
        foreach my $drh (values %drivers) {
            map { $_->{InactiveDestroy} = 1 } @{$drh->{ChildHandles}};
        }
    }
    
  2. or download this
    sub MakeAllDBHsForkSafe {
        my %drivers = DBI->installed_drivers;
        foreach my $drh (values %drivers) {
            map { $_->{InactiveDestroy} = 1 } @{$_->{ChildHandles}};
        }
    }
    
  3. or download this
    sub MakeAllDBHsForkSafe {
        my %drivers = DBI->installed_drivers;
        foreach my $drh (values %drivers) {
          $_->{InactiveDestroy} = 1 for (grep {defined} @{$drh->{ChildHand
    +les}});
        }
    }
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1133086]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (4)
As of 2024-04-18 04:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found