Solved

"Invalid operation : result set closed" ??

Posted on 2004-03-30
6
1,395 Views
Last Modified: 2012-05-04
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
0
Comment
Question by:mmarwaha
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 50

Expert Comment

by:Lowfatspread
ID: 10715859
are you debugging this ?
has db2 closed the cursor / recordset because of a timeout...?

0
 

Author Comment

by:mmarwaha
ID: 10720915
No, I am not debugging this.Its happening in a normal flow.
0
 

Expert Comment

by:jakeDBA
ID: 10731945
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
0
 

Author Comment

by:mmarwaha
ID: 10732010
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
0
 
LVL 1

Accepted Solution

by:
Computer101 earned 0 total points
ID: 12416232
PAQed, with points refunded (50)

Computer101
E-E Admin
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

November 2009 Recently, a question came up in the DB2 forum regarding the date format in DB2 UDB for AS/400.  Apparently in UDB LUW (Linux/Unix/Windows), the date format is a system-wide setting, and is not controlled at the session level.  I'm n…
Recursive SQL in UDB/LUW (you can use 'recursive' and 'SQL' in the same sentence) A growing number of database queries lend themselves to recursive solutions.  It's not always easy to spot when recursion is called for, especially for people una…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
Suggested Courses

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question