Re: Release connections in MODPERL
D. Duccini <duccini@backpack.com>
From: "D. Duccini" <duccini@backpack.com>
To: "Brett W. McCoy" <bmccoy@chapelperilous.net>
Cc: Pgsql-novice <pgsql-novice@postgresql.org>
Date: 2001-01-11T04:26:41Z
Lists: pgsql-novice
Get this, all it takes to release the connection (since PQfinish() doesn't work and there isn't any Pg::disconnectdb() ) is to set the your handle to null !! PERL's garbage collection picks it up and voila! no extra processes hanging in memory. so if you do this: $DBNAME = 'template1'; $SQLCONNECT = "dbname = " . $DBNAME; $SQL = Pg::connectdb($SQLCONNECT); you can simply do this: $SQL = null; otherwise Apache/modperl holds onto the connection and the number of postmaster tasks in memory grows ----------------------------------------------------------------------------- david@backpack.com BackPack Software, Inc. www.backpack.com +1 651.645.7550 voice "Life is an Adventure. +1 651.645.9798 fax Don't forget your BackPack!" -----------------------------------------------------------------------------