I am using WAS6.1 as my app server and looking up a data source on Web sphere. While executing queries using a connection acquired via the data source look-up, I get the following exception trace while executing queries,though it occurs randomly:
Caused by: com.ibm.websphere.ce.cm.ObjectClosedException: DSRA9110E: Statement is closed. at com.ibm.ws.rsadapter.jdbc.WSJdbcStatement.runtimeXIfNotClosed(WSJdbcStatement.java:1505) at com.ibm.ws.rsadapter.jdbc.WSJdbcCallableStatement.getInt(WSJdbcCallableStatement.java:451)
I have tried using a test sql statement to ensure that the connection ppol does not return stale connections but even that does not solve the problem. I have also set Statement cache size to 50. Does anyone have any solution to this issue?
Javaranch has a name policy, that you can find here.
For the stale connection problem, you can lower the aged timeout for the connection pool to a value lesser than the timeout of the database. Also, if you are behind a firewall, you should see if there is some timeout in it also. As a rule of thumb, you could use the following: Connection Pool Timeout Less than Firewall Timeout Less than Database Timeout