perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Perrin Harkins <per...@elem.com>
Subject Re: DBI persistence problem
Date Wed, 01 Dec 2004 22:39:19 GMT
On Wed, 2004-12-01 at 19:00 -0600, Richard N. Fogle wrote:
> The problem we're having is each time the CGI is called it seems to
> make a persistent connection to the database despite the fact that we
> have a $dbh->disconnect(); at the end of the code.

Are you using Apache::DBI anywhere?  Make sure.  Have you verified that
the disconnect really gets called?  You can turn DBI tracing on to find
out what's happening.  I would suggest that you might be trapping a copy
of your $dbh in a closure or a global, but that shouldn't matter if you
actually call disconnect() on it.

> We tried placing the connect strings in startup.PL

Don't do that!  Opening database connections before the server forks
will wreak havoc when multiple processes try to use the same socket.

- Perrin


-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Mime
View raw message