This week's book giveaway is in the Design forum.
We're giving away four copies of Building Microservices and have Sam Newman on-line!
See this thread for details.
The moose likes JDBC and Relational Databases and the fly likes java.sql.SQLException: Connection has already been closed. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Building Microservices this week in the Design forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "java.sql.SQLException: Connection has already been closed." Watch "java.sql.SQLException: Connection has already been closed." New topic

java.sql.SQLException: Connection has already been closed.

Balamurugan Guruswamy

Joined: Dec 21, 2009
Posts: 1
I used to get a lot of incidents raised due to failure of batches. All these incidents point to the same root cause, Connection Exception which its shown below.
Almost once in a week i am getting this issue.

I am using spring1.2.8,weblogic9.2 and oracle10g.
Please can anybody provide solution for
1) Why its happening and how to replicate the issue?
2) Whats the solution for this issue?

java.sql.SQLException: Connection has already been closed.
at weblogic.rjvm.ResponseImpl.unmarshalReturn(
at weblogic.rmi.internal.BasicRemoteRef.invoke(
at weblogic.jdbc.rmi.internal.ConnectionImpl_weblogic_jdbc_wrapper_PoolConnection_oracle_jdbc_driver_T4CConnection_920_WLStub.createStatement(Unknown Source)
at weblogic.jdbc.rmi.SerialConnection.createStatement(
at org.springframework.jdbc.core.JdbcTemplate.execute(
at org.springframework.jdbc.core.JdbcTemplate.query(
at org.springframework.jdbc.core.JdbcTemplate.query(
Caused by: java.sql.SQLException: Connection has already been closed.
at weblogic.jdbc.wrapper.PoolConnection.checkConnection(
at weblogic.jdbc.wrapper.Connection.preInvocationHandler(
at weblogic.jdbc.wrapper.Connection.createStatement(
at weblogic.jdbc.rmi.internal.ConnectionImpl.createStatement(
at weblogic.jdbc.rmi.internal.ConnectionImpl_weblogic_jdbc_wrapper_PoolConnection_oracle_jdbc_driver_T4CConnection_WLSkel.invoke(Unknown Source)
at weblogic.rmi.internal.BasicServerRef.invoke(
at weblogic.rmi.internal.BasicServerRef$
at weblogic.rmi.internal.BasicServerRef.handleRequest(
at weblogic.rmi.internal.BasicServerRef.access$300(
at weblogic.rmi.internal.BasicServerRef$

I agree. Here's the link:
subject: java.sql.SQLException: Connection has already been closed.
It's not a secret anymore!