Prepared statement for callable returning cursor not closed

Description

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:

BOTEMPLATE.PKG_BOT_TESTS.pck

BOT_TEST_NUMVALUE.sql

The data class that maps this table looks like this:

NumValue.java (excerpt)

As mentioned, the following test works fine with Hibernate 3.6 but fails with Hibernate 4.1.9 (ORA-01000: maximum open cursors exceeded):

CursorFromCallableTest.java

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!

Environment

Hibernate 4.1.9 Final
Oracle JDBC Thin Driver 11.2.0.3

Activity

Show:
Lukasz Antoniak
March 21, 2013, 8:40 AM
Brett Meyer
March 25, 2013, 5:49 PM

Thanks to for the pull request!

Christian Bauer
March 27, 2013, 7:43 AM

The latest commit seems to fix the issue I was seeing with Bitronix.

http://jira.codehaus.org/browse/BTM-126

Brett Meyer
September 26, 2013, 2:34 AM

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...

Assignee

Brett Meyer

Reporter

Pierre Post

Fix versions

Labels

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Affects versions

Priority

Critical
Configure