Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number

Answer: Can process share a DBI connection?

( #180696=categorized answer: print w/ replies, xml ) Need Help??

Q&A > database programming > Can process share a DBI connection? contributed by Zaxo

Each process should open its own DBI connection. Processes will readily share one if it's opened before fork, but that has bad side effects, and no good ones that I know of. Two processes talking over one connection may get a db server confused, and the first process to end will take the serverside connection down, with no notification to the surviving process. Further confusion may result when the survivor tries to close its copy.

Moral - Don't call &DBI::connect before a fork, even if one process never uses the connection.

Comment on Answer: Can process share a DBI connection?
Log In?

What's my password?
Create A New User
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (9)
As of 2015-11-25 22:49 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (692 votes), past polls