com.ibm.websphere.ce.cm.ObjectClosedException: DSRA9110E: Statement is closed.
Joined: Jan 18, 2009
I get the below exception when I perform any kind of database operations.
"com.ibm.websphere.ce.cm.ObjectClosedException: DSRA9110E: Statement is closed."
This is happening very randomly and currently it is happening in our QA env when we are doing some performance tests. We are using Websphere Process Server as the runtime container via which the db operations are perofmed. We have a Utility class for all the DB generic operations. That code goes as below:
Are we missing anything here in the above usage. We have many classes that use the above DB Utility class for all the generic DB operations.
Any help is very thankful.
Joined: Oct 08, 2006
1) You need to acquire and close the connection/statement/resultset in the shortest possible scope (inside same method block) to avoid resource/memory leaks.
2) You need to declare the connection/statement/resultset in the method scope as threadlocal variable and certainly not in class scope as instance variable to avoid thread-unsafety.