JBoss Application Server Shows "pingDatabase failed status=-2" When Connecting to Oracle RDBMS (Doc ID 1446547.1)

Last updated on AUGUST 03, 2016

Applies to:

JDBC - Version 11.1.0.6 and later
Information in this document applies to any platform.

Symptoms

Using the Oracle 11.x thin JDBC driver with a connection pool in the JBoss application server, J2EE applications intermittently fail to get a connection to the database server. The JBoss connection pool reports a failure while validating an open connection. The failure is signalled by the JDBC driver's pingDatabase(timeout) method returning a status code of -2.

The JBoss server may show the following stack back-trace:

WARN [org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory] (pool-41-thread-26) Destroying connection that is not valid, due to the following exception: oracle.jdbc.driver.T4CConnection@5e464991
java.sql.SQLException: pingDatabase failed status=-2
        at org.jboss.resource.adapter.jdbc.vendor.OracleValidConnectionChecker.isValidConnection(OracleValidConnectionChecker.java:74)
        at org.jboss.resource.adapter.jdbc.BaseWrapperManagedConnectionFactory.isValidConnection(BaseWrapperManagedConnectionFactory.java:560)
        at org.jboss.resource.adapter.jdbc.BaseWrapperManagedConnection.checkValid(BaseWrapperManagedConnection.java:323)
        at org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.matchManagedConnections(LocalManagedConnectionFactory.java:402)
        at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.getConnection(InternalManagedConnectionPool.java:225)
        at org.jboss.resource.connectionmanager.JBossManagedConnectionPool$BasePool.getConnection(JBossManagedConnectionPool.java:690)
//etc

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