"java.sql.SQLRecoverableException: Io exception: Connection reset" from Oracle JDBC driver in EAP

Solution Verified - Updated -

Environment

  • Red Hat JBoss Enterprise Application Platform (EAP)
    • All versions
  • Oracle DB

Issue

  • What does java.sql.SQLRecoverableException: Io exception: Connection reset from Oracle JDBC driver mean?
Caused by:  java.sql.SQLRecoverableException: Io exception: Connection reset
        at oracle.jdbc.driver.SQLStateMapping.newSQLException(SQLStateMapping.java:101)
        at oracle.jdbc.driver.DatabaseError.newSQLException(DatabaseError.java:133)
        at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:199)
        at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:263)
        at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:521)
        at oracle.jdbc.driver.T4CStatement.executeForDescribe(T4CStatement.java:791)
        at oracle.jdbc.driver.T4CStatement.executeMaybeDescribe(T4CStatement.java:855)
        at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1186)
        at oracle.jdbc.driver.OracleStatement.executeInternal(OracleStatement.java:1770)
        at oracle.jdbc.driver.OracleStatement.execute(OracleStatement.java:1739)
        at oracle.jdbc.driver.OracleStatementWrapper.execute(OracleStatementWrapper.java:299)

Caused by: org.hibernate.exception.JDBCConnectionException: Cannot open connection
    at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:97)
    at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
    at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:52)

Caused by: java.net.SocketException: Connection reset
    at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:96)
    at java.net.SocketOutputStream.write(SocketOutputStream.java:136)

  • Connection reset problem. User is getting connection reset exceptions error on the server.
The Error Code  is : SQL Error: 17002, SQLState: 08006

Resolution

  • The error does not originate with JBoss and may require investigation by:
    • Network administrators
    • Back-end server administrators/database administrators (e.g. Oracle admins)
  • Database connection validation/fault tolerance1 may allow JBoss to recover from the externally originating connection failure
  • The JBoss Idle timeout period may need to be decreased so that connections timeout on JBoss more rapidly than on the database server.

Root Cause

  • This is a generic issue where the connection has been closed or terminated by something outside of the JBoss process.
  • This may be due to a firewall, switches on the network, protocol or other network errors, interruptions in network connectivity, etc.
  • The database server may be terminating the connection
    • The exception may relate to configuration (e.g. timeout period) of the Oracle database server
    • The exception may be due to error conditions in the database server
    • The exception may be due to a defect in the database server or driver
  • A similar exception (with a potentially different cause/resolution) may also occur during login

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Comments