Re: Release connections in MODPERL

Поиск
Список
Период
Сортировка
От D. Duccini
Тема Re: Release connections in MODPERL
Дата
Msg-id Pine.GSO.4.03.10101102222130.15889-100000@ra.bpsi.net
обсуждение исходный текст
Ответ на Re: Release connections in MODPERL  ("Brett W. McCoy" <bmccoy@chapelperilous.net>)
Ответы Re: Release connections in MODPERL
Список 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!"
-----------------------------------------------------------------------------


В списке pgsql-novice по дате отправления:

Предыдущее
От: hubert depesz lubaczewski
Дата:
Сообщение: Re: MSSQL to PgSQL
Следующее
От: Karla Peralta
Дата:
Сообщение: Encrypt