Why doesn't my PerlCGI users postgres connections close down?

From: m(dot)claesson(at)student(dot)ucc(dot)ie (Marcus Claesson)
To: pgsql-general(at)postgresql(dot)org
Subject: Why doesn't my PerlCGI users postgres connections close down?
Date: 2003-02-12 17:15:04
Message-ID: e818c15b.0302120915.5048c235@posting.google.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

I still have the default max number of database connections (32), but
instead of increasing it I want the connections to be closed down
after being used. I get an increasing number of these:

postgres 22906 695 0 13:40 ? 00:00:00 postgres: apache
testdb [local]
postgres 22913 695 0 13:41 ? 00:00:00 postgres: apache
testdb [local]
postgres 22926 695 0 13:47 ? 00:00:00 postgres: apache
testdb [local]
postgres 22933 695 0 13:59 ? 00:00:00 postgres: apache
testdb [local]
p

And I'm using Perl dbi:Pg (as well as DBIx::Recordset) in a CGI
script, and in the end I try to close the connection:

$db = DBIx::Database->new({'!DataSource' => 'dbi:Pg:dbname=testdb',
'!Username' => 'apache',
'!KeepOpen' => 1}) or die "Couldn't
connect to database";
...
*set = DBIx::Recordset->Search({%fdat,('!DataSource' => $db,
'!Table' => $table,
'!Fields' => $joined_col,
'$where' => $query)}) or die
"Couldn't connect to table :$DBI::errstr ";
...
$set -> Disconnect ();

Although this doesn't close any connection and they accumulate in a
way I don't want them to.
If I set '!KeepOpen' to 0 I can't run the script since $db isn't
recognized later on.

Really gratefull for any help!

Regards,
Marcus

Browse pgsql-general by date

  From Date Subject
Next Message Bruce Momjian 2003-02-12 17:28:09 Re: PostgreSQl and Informix
Previous Message Carlos Cajina 2003-02-12 17:14:36 PostgreSQl and Informix