Skip site navigation (1) Skip section navigation (2)

Pooled connections idle timeout

From: Daniele Depetrini <daniele(dot)depetrini(at)criticalpath(dot)net>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: Pooled connections idle timeout
Date: 2008-08-05 17:12:50
Message-ID: 48988A12.4070201@criticalpath.net (view raw or flat)
Thread:
Lists: pgsql-jdbc
Hi All,

I'm running JDBC 8.3-603 drivers against PG server 8.3.3. I'm using 
JDBC3.0 API with connection pooling. Here my pool init code:

        pool = new Jdbc3PoolingDataSource();
        pool.setDataSourceName("DB");
        pool.setServerName(servername);
        pool.setDatabaseName(db);
        pool.setUser(user);
        pool.setPassword(password);
        pool.setPortNumber(port);
        pool.setMaxConnections(maxConn);

Connections are opened and closed via conn=pool.getConnection() / 
conn.close().

I've noted that once a connection get opened since needed, it's never 
really closed, application and database stay connected up to restart. 
Since I'm writing a java server application, my application will 
eventually stay up for a long time and spike of traffics can open a lot 
of connectoins to PG that will never be released, even in low traffic time.

Is there any auto-idle-close mechanism, either client or server level?

Thanks in advance,

Daniele.

Responses

pgsql-jdbc by date

Next:From: Grant QuimbyDate: 2008-08-06 00:56:38
Subject: Weird pause when running statements
Previous:From: Steve FosterDate: 2008-08-05 08:46:05
Subject: Re: macaddr data type and prepared statements

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group