This connection has been closed ERROR!!
posted 11 years ago
I was creating a class for accesing my DB and designing a query to display some information in my JSP page and as I was testing all of a sudden I am getting an error and all of a suddend i am starting to get this error and I have no idea why..
posted 11 years ago
Looks like you are trying to create multiple connections in a loop and close them after use. In that order somewhere your code is trying to use closed connection and throwing the exception.
We can see that in the exception log.
posted 11 years ago
Was this working before? Once, I also encountered this connection closed error, it was a pain to resolve. Make sure you are not using select * in your query. Pick up table fields by their names and try.
Sheriff
posted 11 years ago
Was this working before? Once, I also encountered this connection closed error, it was a pain to resolve. Make sure you are not using select * in your query. Pick up table fields by their names and try.
posted 11 years ago
It was thrown by WebSphere App Server 7.01. It did not make sense that is why it was hard to track. When we changed the select *, it started working.
Also, try deleting and recreating your data source.
posted 11 years ago
It was thrown by WebSphere App Server 7.01. It did not make sense that is why it was hard to track. When we changed the select *, it started working.
Sometimes when the time out property is set on the connection pool of the application server, it forcibly releases the connection back to the pool after the specified period(ie.whatever is specified in the property,like 300 seconds etc). In which case you get the Connection has been Closed error.