Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Lesson learned: Forking & DBI

by Purdy (Hermit)
on Nov 07, 2001 at 06:41 UTC ( #123758=perlmeditation: print w/replies, xml ) Need Help??

I finally got a CGI script to play nicely with forking and doing some DBI work on both the parent & child processes. The database handle was created before the fork and before the 'enlightenment', I was using the same db handle variable in both processes, which led to some very strange results.

To fix this, I created a new db handle within the child process, and all was peachy again. :)

Jason

Replies are listed 'Best First'.
Re: Lesson learned: Forking & DBI
by perrin (Chancellor) on Nov 07, 2001 at 11:45 UTC
    This is the reason that Apache::DBI refuses to cache database connections opened before Apache/mod_perl forks.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (7)
As of 2019-12-15 08:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?