"Sterin, Ilya" wrote:
> 
> You can have many statement handles for each dbh.  I think this is what you
> are refering to.
> 
> $dbh = DBI->connect(.....);
> $sth = $dbh->prepare(.....);
> $sth2 = $dbh->prepare(......);
> $sth->execute();
> $sth2->execute();
> 
> Each query is bound to it's statement handle where all of the statment
> handles can then in fact be bound to one dbh.

Yes, but I think that Eric wants to know what happens if the sth's are
created in forked children. As I understand it, the sth creation has to
do bookkeeping in the dbh. Now, if two different modifications are made
to two copies of the dbh, yet the underlying connection to the database
api is not duped at the fork, I think all hell can break loose. The
safest thing to do is fork, then open dbh, then open sth, then be gone.


> Ilya Sterin
> 
> -----Original Message-----
> From: drdoctor [mailto:drdoctor]On Behalf Of Eric Kolve
> Sent: Sunday, March 11, 2001 11:25 PM
> To: [EMAIL PROTECTED]
> Subject: sharing dbh across forked children
> 
> Is it possible to share a database handle initialized in a parent with
> forked children ?  What I want to do is process a file which needs to
> execute many SELECT statements in parallel.  I am wondering if each
> child needs to instantiate its own dbh or whether you can execute sql
> simultaneously against the same dbh.
> 
> thanks,
> 
> --eric


-- 
Matthew O. Persico
    
http://www.acecape.com/dsl
AceDSL:The best ADSL in Verizon area

Reply via email to