Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Can process share a DBI connection?

by Zaxo (Archbishop)
on Jul 10, 2002 at 07:24 UTC ( [id://180696]=note: print w/replies, xml ) Need Help??


in reply to Can processes share a DBI connection?

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 Re: Can process share a DBI connection?

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (2)
As of 2024-10-03 23:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    The PerlMonks site front end has:





    Results (42 votes). Check out past polls.

    Notices?
    erzuuli‥ 🛈The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.