Re: Release connections in MODPERL

From: "Brett W(dot) McCoy" <bmccoy(at)chapelperilous(dot)net>
To: "D(dot) Duccini" <duccini(at)backpack(dot)com>
Cc: Pgsql-novice <pgsql-novice(at)postgresql(dot)org>
Subject: Re: Release connections in MODPERL
Date: 2001-01-11 05:03:14
Message-ID: Pine.LNX.4.30.0101102351290.19850-100000@chapelperilous.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Brett W. McCoy 2001-01-11 05:39:22 Re: Release connections in MODPERL
Previous Message D. Duccini 2001-01-11 05:01:23 Re: Release connections in MODPERL