java.sql.SQLException: Connection is closed
843859Oct 17 2005 — edited Oct 20 2005Hi,
I am getting the "java.sql.SQLException: Connection is closed" now and then in production there is no code fault as bze this error does not get thrown daily. i am using apache DBCP connection pooling to get the connection.
Sample code is as follows...
con = DBUtil.getConnection();
st = con.createStatement();
......
....
the first statement gets executed successfully and returns connection object . when it goes to create the Statement object the following erros gets posted.
java.sql.SQLException: Connection is closed.0: org.apache.commons.dbcp.DelegatingConnection.checkOpen(DelegatingConnection.java:274)1: org.apache.commons.dbcp.DelegatingConnection.createStatement(DelegatingConnection.java:199)2:
...........
................
I am unable to say the ROOT CAUSE of this issue...Could you please help me to figure out the ROOT CAUSE and when it happens.
My assumption is like Connection object is getting shared across the requests and getting closed pre-maturely.
Thanks in advance..
-Jayaram.