Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re^2: Using fork with DBI to create simultaneous db connections.

by guice (Scribe)
on Mar 23, 2005 at 14:55 UTC ( [id://441784]=note: print w/replies, xml ) Need Help??


in reply to Re: Using fork with DBI to create simultaneous db connections.
in thread Using fork with DBI to create simultaneous db connections.

Either let each child have its own connection, or have a common process (eg the 'mother') handle all the database traffic, and use something else to communicate with this 'db-server-process', some sort of RPC or shared memory or... YMMV.

Okay, I'm having the same error and I'm getting the same with every other thread after the first thread finishes. Any thoughts? I'm doing just that myself; Global dbh in $this->{'dbh'} and each child defines it's own $this->{'_dbh-child'}. As soon as I call the first $this->{'_dbh-child'}->disconnect(), every other disconnect fails or spews out that error above, including the master {'dbh'}.

-- philip
We put the 'K' in kwality!

  • Comment on Re^2: Using fork with DBI to create simultaneous db connections.

Replies are listed 'Best First'.
Re^3: Using fork with DBI to create simultaneous db connections.
by guice (Scribe) on Mar 23, 2005 at 21:48 UTC
    The above can be omitted. Turns out the children where closing out the Global DBI object every time they where closing themselves out. It was causing the error. Moving the Global DBI call to a localized method fixed it right up.

    -- philip
    We put the 'K' in kwality!

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (5)
As of 2024-04-19 04:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found