After migrating from Hibernate 3.6 to 4.1.9, the following use case fails with ORA-01000: maximum open cursors exceeded.
We have a PL/SQL package PKG_BOT_TESTS with a simple function f_test_ReturnNonEmptyCursor returning a cursor with 2 lines where the columns can be mapped to the table BOT_TEST_NUMVALUE:
The data class that maps this table looks like this:
As mentioned, the following test works fine with Hibernate 3.6 but fails with Hibernate 4.1.9 (ORA-01000: maximum open cursors exceeded):
This is the JUnit stack trace:
The test may depend on your Oracle configuration of the maximum number of cursors. The number of iterations should be greater than the configured limit.
Please also note the attached CursorFromCalleable.log file. The information from c3p0 about the multiple prepared statement indicates Hibernate has not closed the prepared statement from the previous call as noted in https://forum.hibernate.org/viewtopic.php?f=1&t=942656.
I may supply additional information if needed. Thank you!
Hibernate 4.1.9 Final
Oracle JDBC Thin Driver 188.8.131.52
Thanks to for the pull request!
I stupidly didn't cherry-pick my follow-up commit to 4.2. Switching to fix version to 4.2.7 to account for that...