On Mon, 29 Jan 2001, Didier Bretin wrote:
> Apparently, the connections opened are not close by the garbage
> collector ...
> Is there a solution to avoid such problem ?
There are several solutions:
* Make postgresql start with a higher number of possible processes:
postmaster -i -B 200 -N 100
This won't get to the underlying cause of your problem, but it may
alleviate the symptoms enough to buy you time to fix the problem.
* Ensure that you close the connections every time after you open them:
Connection con = null;
Statement stmt = null;
con = DriverManager.getConnection (url, myUser, myPassword);
stmt = con.createStatement();
// The rest of your JDBC code that actually does work goes here...
catch (SQLException e)
if (con != null)
This is safe, but has a performance penalty associated with creating the
new connection and associated postgres process every time.
* Use a connection pooling mechanism like PoolMan:
Using connection pooling will lead to higher performance for your
Richard Bullington-McGuire <rbulling(at)microstate(dot)com>
Chief Technology Officer, The Microstate Corporation
Phone: 703-796-6446 URL: http://www.microstate.com/
PGP key IDs: RSA: 0x93862305 DH/DSS: 0xDAC3028E
In response to
pgsql-jdbc by date
|Next:||From: Wayne Johnson||Date: 2001-01-29 15:53:47|
|Subject: Postgresql and JDBC|
|Previous:||From: Jean-Francois Burdet||Date: 2001-01-29 11:11:14|
|Subject: jdbc: v7.1 bug (letter accent)|