commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stephen Westbom <>
Subject RE: How to debug closed connection problems
Date Wed, 15 Jan 2003 01:34:10 GMT

I put some fixes in as well and reported them.  The ones I found are in the result set wrapper
class's close() and next() methods.  The code should check for null in the wrapped result
set because the getResultSet() method that calls the result set wrapper class's constructor
in the statement object can have a null result set reference.  
But back to your problem.  There is probably an idle connection timeout in the DB2 configuration,
check with your DBA.  The pool would have no way of knowing that its underlying socket connection
is dead until it pings the connection on checkout (expensive) or you try to use it.
The other possibility for a dead socket is a firewall or router table timeout of the socket
connection.  Check with your networking or security people.
If either one of these is the problem you will need to set the idle connection timeout accordingly.
 Linda Steckel <> wrote:Frank,

I'd love to have your fixes.

I am having a similar problem with the connections getting closed
unexpectedly after the same code runs for hours. I'm using Oracle 8i. If I
look at the database, it appears that they are connections open (but
irretrievable?), yet the error says "Connection closed". I haven't been
able to figure out what is going on.


-----Original Message-----
From: []
Sent: Tuesday, January 14, 2003 4:49 PM
Subject: How to debug closed connection problems

I'm looking for some suggestions on how to debug a problem my application
is having with closed connections using the commons connection pooling
(the REAL connection gets closed out from under the PoolableConnection).

I am running JDBC from a Window's client to either a local DB2 or a remote
database (Ver 7.2.4) from a Tomact web app.

I got the commons dbcp and pool source and instrumented it with some
printouts and discovered a couple of bugs in that code (very scarry ones
- this code is not ready for prime time). However, I am still getting
the underlying JDBC Connection closed out from under the PoolableConnection.

I instrumented all the code in the commons code where there is a
_conn.close() and all the code calling any of this code and (with my fixes)
I no longer see the pooling code doing the close of the real connection.

I added DriverManager.setLogWriter() to get added information and it does
seem to show a Connection close just before the application tries to close
the PoolableConnection, but unfortunately it doesn't give any traceback to
see who the culprit is.

My application only deals with the PoolableConnections so I don't see how it
can be doing the close of the real connection.

Does anyone have any suggestions on how I can determine what is doing this
real connection close????

-- Frank

To unsubscribe, e-mail:

For additional commands, e-mail:

To unsubscribe, e-mail: 
For additional commands, e-mail: 

Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message