Beefy Boxes and Bandwidth Generously Provided by pair Networks DiBona
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: DBI, fork, and clone.

by Anonymous Monk
on Apr 24, 2007 at 10:52 UTC ( #611691=note: print w/ replies, xml ) Need Help??


in reply to DBI, fork, and clone.

I've had this exact same issue for ages now and tried to come up with all sorts of workarounds. I've tried your method in some test code and I'm still seeing that issue you had in previous article regarding all forked connections still use the same handle. from my test: sol::kenjim$ ./inactive_test.pl 4326 parent: DBI::db=HASH(0x823d6ec) :1 4327 child: DBI::db=HASH(0x832c4a0) :1 4326 parent: DBI::db=HASH(0x823d6ec) :1 4328 child: DBI::db=HASH(0x832c4a0) :1 4326 parent: DBI::db=HASH(0x823d6ec) :1 4329 child: DBI::db=HASH(0x832c4a0) :1 4326 parent: DBI::db=HASH(0x823d6ec) :1 4330 child: DBI::db=HASH(0x832c4a0) :1 4326 parent: DBI::db=HASH(0x823d6ec) :1 4331 child: DBI::db=HASH(0x832c4a0) :1 the first value is the pid, but each child has the same memory address, so I assume they still are sharing connections. I need each child to have its own connection as well... a little stumped.


Comment on Re: DBI, fork, and clone.
Re^2: DBI, fork, and clone.
by kyle (Abbot) on Apr 24, 2007 at 16:23 UTC

    A few brief comments...

    1. I'd be interested to see the code you say is not working. Without seeing it, it's hard to tell what might be going on.
    2. The problem really concerns shared connections (and avoiding them). I'm not sure that same memory addresses (in different processes) implies same connections.
    3. Letting each child have its own connection is easiest if you can close the parent's connection first. In my case, that wasn't feasible, but maybe it is in your case.

    Thanks for your comments.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (7)
As of 2014-04-19 09:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (480 votes), past polls