[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [cgiapp] Lazy DBI


On Feb 19, 2008 5:02 AM, Mark Knoop <suppressed> wrote:
> I would be interested to know of any flaws in my logic...

This is okay for CGI.  It would not be good for any persistent
environment like FastCGI, PerlEx, or mod_perl.  It those environments
it will break if your database connection times out from inactivity or
if you restart your database server (it won't reconnect on the next
request).

If you get rid of the "our $dbh" and call connect_cached() instead of
connect(), it will accomplish the same thing, but also work without
changes when you switch to a persistent environment.

- Perrin

#####  CGI::Application community mailing list  ################
##                                                            ##
##  To unsubscribe, or change your message delivery options,  ##
##  visit:  http://www.erlbaum.net/mailman/listinfo/cgiapp    ##
##                                                            ##
##  Web archive:   http://www.erlbaum.net/pipermail/cgiapp/   ##
##  Wiki:          http://cgiapp.erlbaum.net/                 ##
##                                                            ##
################################################################


Mail converted by mhonarc 2.6.15
This archive provided courtesy of JSW4.NET, Internet Hosting Services for Small Business.