Re: DBI persistence problem

[prev] [thread] [next] [Date index for 2004/12/01]

From: Perrin Harkins
Subject: Re: DBI persistence problem
Date: 22:39 on 01 Dec 2004
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

DBI persistence problem
Richard N. Fogle 01:00 on 02 Dec 2004

Re: DBI persistence problem
Malcolm J Harwood 22:36 on 01 Dec 2004

Re: DBI persistence problem
Perrin Harkins 22:39 on 01 Dec 2004

Re: DBI persistence problem
Richard N. Fogle 01:26 on 02 Dec 2004

Re: DBI persistence problem
Malcolm J Harwood 23:10 on 01 Dec 2004

Re: DBI persistence problem
Richard N. Fogle 23:48 on 01 Dec 2004

Re: DBI persistence problem
Perrin Harkins 19:16 on 02 Dec 2004

Re: DBI persistence problem
Rob Mueller 19:46 on 02 Dec 2004

Generated at 11:26 on 21 Dec 2004 by mariachi v0.52