Does anyone know the best way to identify stale connections in a connection pool? Our application resides on a webfarm and connects to a DB2 database on an OS/390 mainframe using DB2Connect. The problem is the database is set to break connections after 10 minutes but the database does not notify DB2Connect when a connection has timed out and therefore my connection pool class still thinks the connection is available thus causing errors when a servlet grabs a stale connection. What is the best way for the connectionpool class to determine if the connection is still valid? (I've tried connection.isClosed() and this does not work) Would getMetaData be an option? Or what about a simple query to test it? Any help is greatly appreciated!
subject: Recognizing stale connections in connection pool