"The connection is closed" / "Closed Connection" exception raised by JDBC driver deployed in JBoss EAP

Solution Verified - Updated -

Issue

  • JDBC driver raises an exception like the below indicating connection closure:

    Microsoft SQL Server

    ... com.microsoft.sqlserver.jdbc.SQLServerException: The connection is closed.
        ...
        at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError(SQLServerException.java:...)
        at com.microsoft.sqlserver.jdbc.SQLServerConnection.checkClosed(SQLServerConnection.java:...)
        at com.microsoft.sqlserver.jdbc.SQLServerStatement.checkClosed(SQLServerStatement.java:...)
    
    ... com.microsoft.sqlserver.jdbc.SQLServerException: The connection is closed.
        at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError(SQLServerException.java:...)
        at com.microsoft.sqlserver.jdbc.SQLServerConnection.checkClosed(SQLServerConnection.java:...)
        at com.microsoft.sqlserver.jdbc.SQLServerConnection.prepareStatement(SQLServerConnection.java:...)
    

    Oracle

    ... java.sql.SQLRecoverableException: Closed Connection
        at oracle.jdbc.driver.PhysicalConnection.createStatement(PhysicalConnection.java:3423)
        ...
    
    ... java.sql.SQLRecoverableException: Closed Connection
        at oracle.jdbc.driver.PhysicalConnection.setAutoCommit(PhysicalConnection.java:2232)
        ...
    
    ...  java.sql.SQLException: Closed Connection
        ...
        at oracle.jdbc.driver.PhysicalConnection.prepareStatement(PhysicalConnection.java:868)
    

Environment

  • Red Hat JBoss Enterprise Application Platform
    • 7
    • 6
    • 5
  • All databases

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In