This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
I have the following code , which works fine normally. We found a exception for "java.sql.SQLException: Closed Connection" in a demo site recently. I don't understand why connection is closed , and what could be the reason.
In demo site, it happens everytime, so it looks like not other thread to close the connection.
Could anyone point me the possible reason for "java.sql.SQLException: Closed Connection" in this case?
2010-09-07 06:44:37,411logp.251 - java.sql.SQLException: Closed Connection
java.sql.SQLException: Closed Connection
You are getting a Closed Connection exception because by line 805, your connection object m_conn is getting closed.
It won't be possible to tell why it is getting closed with the code you have provided.
Instead of using
useThat should stop the application from throwing the exception. But, to find out why the connection is closed, you will have to dig in some more ito your code.
They say you have to be the first, the best or different. I say, is it too much to ask for all three.
Joined: May 17, 2004
Thanks for the reply. Since the demo site is using shiphome, we can't add the debugger for it. But in development env, we haven't met this case before. That make me very curious how the connection could be closed .