in reply to Parllel Processing Database Query
So you can try:my $fork_manager = new Parallel::ForkManager(10); $fork_manager->start and next; # fork # Clone parent dbh my $dbh_child = $dbh->clone(); $dbh->{InactiveDestroy} = 1; $dbh = $dbh_child;
Hope this helpssub db_execution { ... my $dbh = $db->connect( 'students' ) or die $!; my $dbh_child = $dbh->clone(); $dbh->{InactiveDestroy} = 1; $dbh = $dbh_child; my $sth = $dbh->prepare( $sql ) or die "$!:" . $dbh->errstr; $sth->execute or die "$!:" . $sth->errstr; ... }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Parllel Processing Database Query
by whakka (Hermit) on Jul 29, 2009 at 13:31 UTC |