Closing one connection closes all connections?

From: Ian McFarland <imf(at)neo(dot)com>
To: pgsql-jdbc(at)postgresql(dot)org
Cc: Ian McFarland <ian(at)neo(dot)com>
Subject: Closing one connection closes all connections?
Date: 2003-03-04 10:34:35
Message-ID: E486BF4C-4E2C-11D7-B1F0-0003938E4906@neo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Greetings,

I'm getting interesting behavior from connection pooling when I use
PostgreSQL + pg73jdbc2ee.jar: specifically, closing one connection from
the pool seems to close all connections: (This example using Tomcat.)

Test 0.
Comparing two connection objects from PostgreSQL driver:
org(dot)apache(dot)commons(dot)dbcp(dot)PoolableConnection(at)895cb9,
org(dot)apache(dot)commons(dot)dbcp(dot)PoolableConnection(at)26a4a2: Equal? false
con.isClosed(): false
con2.isClosed(): false
Closing con with con.close()
con.isClosed(): true
con2.isClosed(): true
End of test 0.

The connection in question is being returned from a
datasource.getConnection() call. As a separate issue, sometimes this
same call will in fact return the same instance of a connection in two
subsequent calls. I haven't gone and looked at the spec yet, but this
seems to me to be incorrect behavior. (As does the behavior illustrated
above.)

Where is the canonical source for the JDBC driver, anyway? I'd love to
look through the source for it and see if I can track down this issue.

Are people using connection pooling with PostgreSQL successfully in
production code? Do I have the wrong version of the JAR? I tried to
find more on this in the list archives, but wasn't able to so far.
Sorry if this is a FAQ and I'm overlooking something.

Cheers,
-Ian

Browse pgsql-jdbc by date

  From Date Subject
Next Message Rich Cullingford 2003-03-04 13:10:32 More on updates with first() vs absolute()
Previous Message Ian McFarland 2003-03-04 10:15:20 Closing one connection closes all connections?