Glassfish Server Getting Stale and Closed JDBC Connections with JDBC Connection Validation Enabled (Doc ID 1279829.1)

Last updated on NOVEMBER 05, 2016

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***

Symptoms

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(DBError.java:134)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:269)
at oracle.jdbc.driver.OracleConnection.privateCreateStatement(OracleConnection.java:839)
at oracle.jdbc.driver.OracleConnection.createStatement(OracleConnection.java:793)
at com.sun.gjc.spi.base.ConnectionHolder.createStatement(ConnectionHolder.java:240)
at org.apache.jsp.test_jsp._jspService(test_jsp.java from :72)
... 34 more
|#]


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

Changes

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.

Cause

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