"The connection is closed" / "Closed Connection" exception raised by JDBC driver deployed in JBoss EAP
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)
PostgreSQL
... org.postgresql.util.PSQLException: Connection has been closed. at org.postgresql@xx.xx.xx//org.postgresql.ds.PGPooledConnection$ConnectionHandler.invoke(PGPooledConnection.java:326) ...
Environment
- Red Hat JBoss Enterprise Application Platform
- 8
- 7
- 6
- 5
- All databases
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.