Glassfish Server Getting Stale and Closed JDBC Connections with JDBC Connection Validation Enabled

(Doc ID 1279829.1)

Last updated on MAY 04, 2018

Applies to:

Oracle GlassFish Server - Version 2.0 and later
Information in this document applies to any platform.
***Checked for relevance on 22-Aug-2013***


When an application requests a JDBC connection from the connection pool,  the connection returned may not be usable and throws the following exceptions:

[#|2010-07-13T15:38:01.609+0800|SEVERE|sun-appserver2.1|javax.enterprise.system.container.web|_ThreadID=25;_ThreadName=httpSSLWorkerThread-8080-1;_RequestID=3f803bba-7584-4d87-940f-1866b35e32f1;|StandardWrapperValve[jsp]: PWC1406: Servlet.service() for servlet jsp threw exception
java.lang.Exception: java.sql.SQLException: Closed Connection
Caused by: java.sql.SQLException: Closed Connection
at oracle.jdbc.dbaccess.DBError.throwSqlException(
at oracle.jdbc.dbaccess.DBError.throwSqlException(
at oracle.jdbc.dbaccess.DBError.throwSqlException(
at oracle.jdbc.driver.OracleConnection.privateCreateStatement(
at oracle.jdbc.driver.OracleConnection.createStatement(
at com.sun.gjc.spi.base.ConnectionHolder.createStatement(
at org.apache.jsp.test_jsp._jspService( from :72)
... 34 more

This problem occurs even if the pool is configured with a valid connection validation method.


This problem can occur when the connection pool is configured to use the "associate-with-thread" option, and the back end database is restarted, even when the pool is configured with an effective database connection validation method.


Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms