Rohan Hart wrote:
> CHEN SEI-LIM writes:
> > How could you know DBD::Oracle can't be shared after forking?
> > How could you prove it?
> > Have you made a program to try it?
> > If you have not, try it then please tell me the result.
>
> The following script results in the parent failing with:
> DBD::Oracle::db prepare failed: ORA-12571: TNS:packet writer failure
> (DBD ERROR: OCIStmtExecute/Describe) ...
>
> Moving wait and fork around so that different statements execute in
> parallel gives, at best:
>
> DBD::Oracle::st fetchrow_hashref failed: ORA-12592: TNS:bad packet
> (DBD ERROR: OCIStmtFetch) ...
>
> DBD::Oracle::st fetchrow_hashref failed: ORA-12569: TNS:packet
> checksum failure (DBD ERROR: OCIStmtFetch) ...
>
> and an "Internal heap ERROR" with various (probably spurious) Oracle
> errors at worst.
>
> ----------------------------------------
> use DBI;
>
> $db = DBI->connect(...)
> or die $DBI::errstr;
>
> $pid = fork;
> if ($pid) {
> # parent
> wait;
> $st = $db->prepare("select * from customer");
> $st->execute;
> while ($st->fetchrow_hashref) {};
> } else {
> # child
> $st = $db->prepare("select * from customer");
> $st->execute;
> while ($st->fetchrow_hashref) {};
> }
> ----------------------------------------
I have to SAY SORRY TO EVERYBODY THAT I AM WRRONG.
And, can you help me to test the following script. How about the results?
If I know what happens maybe I can realize Oracle more.
And the other thing is what's your using OS?
----------------------------------------
use DBI;
$db = DBI->connect(...)
or die $DBI::errstr;
$pid = fork;
if($pid == 0) {
$st = $db->prepare("select * from customer");
$st->execute;
$st->finish;
while ($st->fetchrow_hashref) {};
}
exit;
----------------------------------------