Red Hat Bugzilla – Bug 823773
DB2 & human tasks: Invalid operation: result set is closed
Last modified: 2016-09-20 01:16:17 EDT
Created attachment 585937 [details]
stack trace of the error from the server log
Description of problem:
When running jBPM Console with DB2 database the following error occurs when the console queries for (personal) tasks:
ERROR [org.hibernate.util.JDBCExceptionReporter] (Thread-27) [jcc][t4][4.12.55] Invalid operation: result set is closed. ERRORCODE=-4470, SQLSTATE=null
ERROR [org.jbpm.task.service.TaskServerHandler] (Thread-27) org.hibernate.exception.GenericJDBCException: could not execute query
According to this: http://www-01.ibm.com/support/docview.wss?uid=swg21461670 the cause is that: "The IBM Data Server Driver for JDBC and SQLJ automatically closes the cursor when all rows have been retrieved from a ResultSet. When ResultSet.next is executed after the cursor is closed the SQLException is thrown."
The same page also contains some helpful info on how to resolve this.
Version-Release number of selected component (if applicable):
BRMS 5.3 ER7
Default assignee is kind of buggy. Reassigning to Marco, as he delt with the previous db2 problem. Feel free to change that.
No problem. Thanks for the link to the ibm site, Zuzana.
The ibm page seems to imply that this is a bug in hibernate 3.3.2, however maybe there's some way around it.
Zuzana, could you check which version of hibernate is being used in your tests?
I thought it was 3.3.2.GA, but org.hibernate.loader.Loader isn't longer than 2379 lines in 3.3.2.GA (and the stack trace implies it's at least 2458 lines long).
Also, could you try testing with the following string appended to the jdbc url:
(In reply to comment #4)
> Zuzana, could you check which version of hibernate is being used in your
Looking at the server's Hibernate JARs, they say "3.3.2.GA_CP04"
(In reply to comment #5)
The property added to the URL does actually help. I think that this turns into a documentation issue now. Reassigning to Lee.
Marco, would you be able to provide the BZ/JIRA in Hibernate that causes this? So that we can track it in the future.
Created attachment 586647 [details]
Unfortunately we're still getting the SQL exception even with allowNextOnExhaustedResultSet=1. See attached data source. More investigation will be needed.
I noticed that the following setting was missing from the ds.xml:
I don't think this the fix, but the following sites seem to indicate that it's needed:
I've been able to reproduce the problem.
The solution to this seems to be making sure a transaction happens around queries that find at least one row/result.
I will probably spend most of the time checking whether it causes other bugs.
Sorry, to clarify: I'll be making sure all queries run within a transaction.
Finished coding 90% of the solution and currently testing and working out kinks.
I've finished testing and coding the solution, and am now organizing the commits and adding some necessary documentation in the code (for developers who look at the code later).
This issue's fixes have been picked by ER9. Please verify them on ER9.
Works like magic. Thanks.