com.ibm.websphere.ce.cm.ObjectClosedException: DSRA9110E: ResultSet is closed.


While running the applications on the websphere we do encounter the error com.ibm.websphere.ce.cm.ObjectClosedException: DSRA9110E: ResultSet is closed.
There are many reasons for why we get this error and so do equal number of solutions. I have scenerio where the result set is shared by the class APIs and started encountering this error. One of the good solutions I implemented is setting the resultSetHoldability property from 2 to 1 (Please see the documentations of WebSphere for furthur details.) After changing this property value please restart the server for the property to reset. This is one of the GREATEST APP SERVER.

The stacktrace look something like this.
com.ibm.websphere.ce.cm.ObjectClosedException: DSRA9110E: ResultSet is closed.
at com.ibm.ws.rsadapter.jdbc.WSJdbcResultSet.runtimeXIfNotClosed(WSJdbcResultSet.java:2691)
at com.ibm.ws.rsadapter.jdbc.WSJdbcResultSet.next(WSJdbcResultSet.java:2478)
....

....
....
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:615)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:310)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
at $Proxy7.generateReport(Unknown Source)
.....

.....
at org.springframework.scheduling.commonj.DelegatingWork.run(DelegatingWork.java:61)
at com.ibm.ws.asynchbeans.J2EEContext.run(J2EEContext.java:1112)
at com.ibm.ws.asynchbeans.WorkWithExecutionContextImpl.go(WorkWithExecutionContextImpl.java:195)
at com.ibm.ws.asynchbeans.CJWorkItemImpl.run(CJWorkItemImpl.java:187)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1510)


The one of the solution for this is go to the admin console and select JDBC->Data Sources->Custom Properties->resultSetHoldability and change its value from 2 to 1.

Followers