Re: Release connections in MODPERL - Mailing list pgsql-novice

From Brett W. McCoy
Subject Re: Release connections in MODPERL
Date
Msg-id Pine.LNX.4.30.0101102351290.19850-100000@chapelperilous.net
Whole thread Raw
In response to Re: Release connections in MODPERL  ("D. Duccini" <duccini@backpack.com>)
List pgsql-novice
On Wed, 10 Jan 2001, D. Duccini wrote:

> Get this, all it takes to release the connection (since PQfinish() doesn't
> work and there isn't any Pg::disconnectdb() )

Right, because it relies on the DESTROY method to be called when the
reference goes away, but this doesn't work in mod_perl, alas.

However, in DBI, you can (and should) explicitly close the database
connection with the disconnect method, if you want it closed.

> is to set the your handle to null !!
>
> PERL's garbage collection picks it up and voila!  no extra processes
> hanging in memory.

Except you mean undef, right?  There is no null in Perl.  Even so, though,
undef does not call object destructors (i.e., DESTROY method), only
decrements the reference count, which hopefully means it wil get garbage
collected.

-- Brett
                                     http://www.chapelperilous.net/~bmccoy/
---------------------------------------------------------------------------
I know not with what weapons World War III will be fought, but World
War IV will be fought with sticks and stones.
        -- Albert Einstein


pgsql-novice by date:

Previous
From: "D. Duccini"
Date:
Subject: Re: Release connections in MODPERL
Next
From: "Brett W. McCoy"
Date:
Subject: Re: Release connections in MODPERL