Connection in Pool Closed when calling getConnection()
843854Nov 23 2004 — edited Jan 25 2005Hi All,
My current application is using an Oracle Connection Pool and and Cache (max of 10 using a fixed wait scheme) to provide a pool of connections from a servlet to our database. Which works well.
The problem is that in production the servlet is running 24/7 and clients have reported that a sql exception reporting that the connection is closed is being thrown by the pool every morning when the application attempts to recover a connection from the pool. The only way they have found to recover from this is to shutdown and restart the servlet.
As close as I can tell the application is NOT explicitly closing any of the connections which leaves the following possiblilties:
a) The DB is closing the physical connection(s) after a period of inactivity and the pool is not being informed the pool then tries to recover the connection causing the exception to be generated.
b) The pool is closing the connection after a period of inactivity (utilising the Cache Inactivity Timeout property) and is not cleaningup after itself.
I was wondering if anyone had come across such a situation before and has a solution or at least a direction for me to start looking.
My current fall back position is to detect the closed connection message and flush the pool when it occurs. I would prefer somthing more eligant and less drastic.