JDBC Connection Validation Broken in GlassFish Server 2.1.1 Patch 9 and Patch 10 (Doc ID 1289919.1)

Last updated on NOVEMBER 05, 2016

Applies to:

Oracle GlassFish Server - Version: 2.1.1 to 2.1.1 - Release: 2.1 to 2.1
Information in this document applies to any platform.

Symptoms

The typical symptom for this problem is your application receiving a SQLException from a connection that has just been obtained from a JDBC Connection Pool.  For example:

[#|2011-01-31T14:39:28.209+0000|INFO|sun-appserver2.1.1|javax.enterprise.system.stream.out|_ThreadID=16;_ThreadName=httpSSLWorkerThread-2111-0;|java.sql.SQLException: No more data to read from socket
        at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
        at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:146)
        at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:208)
        at oracle.jdbc.driver.T4CMAREngine.unmarshalUB1(T4CMAREngine.java:1123)
        at oracle.jdbc.driver.T4CMAREngine.unmarshalSB1(T4CMAREngine.java:1075)
        at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:480)
        at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:219)
        at oracle.jdbc.driver.T4CPreparedStatement.executeForDescribe(T4CPreparedStatement.java:813)
        at oracle.jdbc.driver.OracleStatement.executeMaybeDescribe(OracleStatement.java:1049)
        at oracle.jdbc.driver.T4CPreparedStatement.executeMaybeDescribe(T4CPreparedStatement.java:854)
        at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1154)
        at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3370)
        at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:3415)
        at org.apache.jsp.pool_jsp._jspService(pool_jsp.java from :114)
        at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:109)

Note that the SQLException received could vary depending on the SQL operation being attempted as well as on the version of JDBC driver or database being used.

In addition, the JDBC Connection Pool must have been configured with validation enabled, in the example below replace "OraclePool" with the name of your JDBC Connection Pool:

$ asadmin get --user admin domain.resources.jdbc-connection-pool.OraclePool.is-connection-validation-required
domain.resources.jdbc-connection-pool.OraclePool.is-connection-validation-required = true

If the connection pool does not have validation enabled then seeing SQLExceptions in your application is entirely possible as the connection pool does not test the connection before supplying it to your requesting application.  Therefore, if the database has been restarted, the pool will contain "bad" connections which potentially won't be removed until the instance is restarted, and will cause errors until it is.


Changes

You've upgraded from an earlier version of the GlassFish Server to either 2.1.1 patch 9 or patch 10.

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