mmarwaha
asked on
"Invalid operation : result set closed" ??
I am using UDB 8.0 on Windows (trial version).I am using type 4 driver (db2jcc.jar) and my Web application
runs on Weblogic 7.1sp3.I call a stored procedure (witih an EJB method) that returns me a resultSet of 5 records.I traverse thru the result set using a simple while(rs.next()) { ...}.
I am seeing that after reading the first record when it comes back to read the second record (ie calls while(rs.next() the second tiime) , an SQLException is thrown saying "Invalid operation : result set closed".Sounds strange since in the while loop the resultSet rs is never closed.
Would really appreciate, if anyone could give me hints what could be going wrong ?
Thanks in advance
-mmarwaha
runs on Weblogic 7.1sp3.I call a stored procedure (witih an EJB method) that returns me a resultSet of 5 records.I traverse thru the result set using a simple while(rs.next()) { ...}.
I am seeing that after reading the first record when it comes back to read the second record (ie calls while(rs.next() the second tiime) , an SQLException is thrown saying "Invalid operation : result set closed".Sounds strange since in the while loop the resultSet rs is never closed.
Would really appreciate, if anyone could give me hints what could be going wrong ?
Thanks in advance
-mmarwaha
ASKER
No, I am not debugging this.Its happening in a normal flow.
I'm having a very similar problem -- a db2 udb 8.1 based app using ejb with jboss. Get the same error when it's clear I'm not explicity closing the resultset. I'm also using the type 4 driver. I tried setting the "holdability" to HOLD_ACROSS_COMMITS as has been discussed elsewhere on the net, but this did not help. Have you had any luck yet?
JakeDBA
JakeDBA
ASKER
Yes, to some extent I could figure out the problem.We are using hibernate as our DAO layer to interact with the
database.My problem was I was using the same connection object to initialize the hibernate session and also used the
same connection object to create my statement within the same scope.When I explicitly used a different connection object for the hibernate session, my problem was solved.
I guess you should check that your connection,statement and result set is not used explicilty for the query/stored proc you are worried about.
Hope this helps
-mmarwaha
database.My problem was I was using the same connection object to initialize the hibernate session and also used the
same connection object to create my statement within the same scope.When I explicitly used a different connection object for the hibernate session, my problem was solved.
I guess you should check that your connection,statement and result set is not used explicilty for the query/stored proc you are worried about.
Hope this helps
-mmarwaha
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
has db2 closed the cursor / recordset because of a timeout...?