Re: mp2 and Class:DBI

[prev] [thread] [next] [Date index for 2005/01/05]

From: Stas Bekman
Subject: Re: mp2 and Class:DBI
Date: 05:49 on 05 Jan 2005
Mike Carlton wrote:
[...]
> But isn't there a problem with making db connections from startup.pl? 
> When the processes later fork, you potentially wind up with database
> connection problems (I saw lots of problems under MP1 when I was doing
> this).
> 
> Particularly with Class::DBI::mysql, just loading a class makes a
> database connection.  Is there a safe way to make database connections
> from startup.pl and not have it blow up?

Not if you use PerlChildInitHandler to open the actual connection, like 
Apache::DBI does:
http://modperlbook.org/html/ch20_02.html

        -- 
        __________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@xxxxxx.xxx http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

mp2 and Class:DBI
Sean T Allen 19:18 on 04 Jan 2005

Re: mp2 and Class:DBI
Perrin Harkins 20:47 on 04 Jan 2005

Re: mp2 and Class:DBI
Mike Carlton 05:42 on 05 Jan 2005

Re: mp2 and Class:DBI
Stas Bekman 05:49 on 05 Jan 2005

Re: mp2 and Class:DBI
Randy Kobes 20:58 on 05 Jan 2005

Re: mp2 and Class:DBI
Perrin Harkins 21:13 on 05 Jan 2005

Re: mp2 and Class:DBI
Stas Bekman 21:13 on 05 Jan 2005

Re: mp2 and Class:DBI
Perrin Harkins 05:56 on 05 Jan 2005

Generated at 12:16 on 16 Jan 2005 by mariachi v0.52