Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
What will happen in case when multiple processes try to use their copies of $dbh at the same time?... my $dbh = DBI->connect($source, $uname, $auth, \%attr); while(1){ ########################## # accept() code goes here ########################## my $cid = fork(); if (defined $cid){ if ($cid == 0){ my $statement = q!a SQL statement goes here!; my $sth = $dbh->prepare($statement); $rv = $sth->execute; ... etc ... exit 0; } }else{ # handle the error } ...
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Sharing a database handle over multiple processes
by pope (Friar) on Jun 28, 2001 at 13:00 UTC | |
|
Re: Sharing a database handle over multiple processes
by Zapawork (Scribe) on Jun 28, 2001 at 07:04 UTC | |
|
Re: Sharing a database handle over multiple processes
by voyager (Friar) on Jun 28, 2001 at 05:35 UTC | |
by suaveant (Parson) on Jun 28, 2001 at 06:20 UTC | |
|
Re: Sharing a database handle over multiple processes
by VSarkiss (Monsignor) on Jun 28, 2001 at 07:01 UTC | |
|
Re: Sharing a database handle over multiple processes
by fs (Monk) on Jun 28, 2001 at 05:33 UTC |