Monday, 12 August 2013

resultset is closed exception on first iteration of .next()

resultset is closed exception on first iteration of .next()

i cant figure out why my resultset is throwing the exception.. Resultset
object is not null in debugging, however it cannot enter the if statement
if(resultset.next()) I'm not sure what i'm doing wrong.. Thanks for any
help.
Here is the relevant code:
input = new Object[]{nEventID, nEventID, nAccountID};
callback = new
NamedQueryStatementCallback("GET_ACTIVE_EVENT_ENTITLEMENT_DETAILS",
input, false);
resultSet = (ResultSet)getHibernateTemplate().execute(callback);
if (resultSet != null)
{
outputList = new ArrayList();
if (resultSet.next()) //here is where exception gets thrown - on first
iteration, so it never enters branch
{
do
{
//create object list with data
}while (resultSet.next());
}
}
stacktrace:
java.lang.reflect.UndeclaredThrowableException
at $Proxy42.next(Unknown Source)
at
com.citibank.cain.dao.impl.NoticeboardDAOImpl.getEntitlementDetails(NoticeboardDAOImpl.java:1917)
at
com.citibank.cain.dao.impl.NoticeboardDAOImpl.getEntitlementDetails(NoticeboardDAOImpl.java:1844)
at
com.citi.testing.cain.stepDefinitions.UseJdbcStepDefinition.Then_Noticeboard_should_connect_through_JDBC_and_return_entitlements_list(UseJdbcStepDefinition.java:72)
at ✽.And Then Noticeboard should connect through JDBC and return
entitlements
list(C:\workspaceGIT\CAINCucumberFixtures\src\test\resources\cain\UseJdbc.feature:13)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.citibank.framework.db.GenericHandler.invoke(GenericHandler.java:44)
at $Proxy42.next(Unknown Source)
at
com.citibank.cain.dao.impl.NoticeboardDAOImpl.getEntitlementDetails(NoticeboardDAOImpl.java:1917)
at
com.citibank.cain.dao.impl.NoticeboardDAOImpl.getEntitlementDetails(NoticeboardDAOImpl.java:1844)
at
com.citi.testing.cain.stepDefinitions.UseJdbcStepDefinition.Then_Noticeboard_should_connect_through_JDBC_and_return_entitlements_list(UseJdbcStepDefinition.java:72)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at cucumber.runtime.Utils$1.call(Utils.java:44)
at cucumber.runtime.Timeout.timeout(Timeout.java:12)
at cucumber.runtime.Utils.invoke(Utils.java:40)
at
cucumber.runtime.java.JavaStepDefinition.execute(JavaStepDefinition.java:35)
at cucumber.runtime.StepDefinitionMatch.runStep(StepDefinitionMatch.java:38)
at cucumber.runtime.Runtime.runStep(Runtime.java:268)
at cucumber.runtime.model.StepContainer.runStep(StepContainer.java:45)
at cucumber.runtime.model.StepContainer.runSteps(StepContainer.java:40)
at cucumber.runtime.model.CucumberScenario.run(CucumberScenario.java:36)
at cucumber.runtime.model.CucumberFeature.run(CucumberFeature.java:112)
at cucumber.runtime.Runtime.run(Runtime.java:105)
at cucumber.runtime.Runtime.run(Runtime.java:93)
at cucumber.api.cli.Main.run(Main.java:20)
at cucumber.api.cli.Main.main(Main.java:12)
Caused by: com.ibm.db2.jcc.am.SqlException:
[jcc][t4][10120][10898][3.65.77] Invalid operation: result set is
closed. ERRORCODE=-4470, SQLSTATE=null
at com.ibm.db2.jcc.am.cd.a(cd.java:682)
at com.ibm.db2.jcc.am.cd.a(cd.java:60)
at com.ibm.db2.jcc.am.cd.a(cd.java:103)
at com.ibm.db2.jcc.am.ResultSet.checkForClosedResultSet(ResultSet.java:4528)
at com.ibm.db2.jcc.am.ResultSet.nextX(ResultSet.java:329)
at com.ibm.db2.jcc.am.ResultSet.next(ResultSet.java:308)
at
org.apache.commons.dbcp.DelegatingResultSet.next(DelegatingResultSet.java:207)
at
org.apache.commons.dbcp.DelegatingResultSet.next(DelegatingResultSet.java:207)
... 27 more

No comments:

Post a Comment