Quote:
Originally posted by yogeshts
I am using UDB 8.0 on AIX. I am using type 4 driver (db2jcc.jar) and my Web application
runs on Websphere.I call a stored procedure/sql (witih an EJB method) that returns me a resultSet of few records.I traverse thru the result set using a simple while(rs.next()) { ...}. When I do this, an SQLException is thrown saying "Invalid operation : result set closed".
I found this to happen in 4 Scenarios.
Case 1:
When there is no row in the resultset and i try to do a rs.next().( doesnt throw the exception always. works fine in few places )
Case 2:
When I traverse beyond the last record and i try to do a rs.next().( always throws the exception. looks like a valid case... but i dont get this in oracle )
Case 3:
We are using hibernate as our DAO layer to interact with the database. While traversing forward through the resultset, if i use the same connection( which had created the resultset using a preparedstatement ) to inititialize a hibernate session, the rs.next() immediately following the initialization throws me the exception.
Case 4:
when i do a rs.next(), even if the resultset has records and the cusror position is valid . ( again this doesnt happen always .. works fine in most places )
I feel some configuration parameter is missing which is causing this problem.
Would really appreciate, if anyone could give me hints what could be going wrong ?
|
This sounds like very strange (buggy) behaviour... what is hibernate?
rs.next() should return false if there are no rows/none left, it shouldn't thrown an exception unless something else is wrong.
You might want to take a JDBC/CLI trace, although at that point engaging IBM support might be a good call. You can spend a lot of time mucking around with those.