-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Calling stored procedures can leave open cursors #2915
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Looks like Vlad also succeeded at adding Trying to mimic the pattern shown in the article is actually convoluted considering we support both Hibernate and EclipseLink. However, we can detect the existence of |
If the JPA provider's implementation of StoredProcedureQuery implements AutoCloseable, invoke the close method when completed. Resolves #2915.
Since this involves Hibernate 6, this should also be backported to Spring Data JPA 3.0 as well. |
Executing multiple stored procedures via
@Procedure
can lead to an oracle exception (ORA-01000: maximum open cursors exceeded) because Hibernate keeps cursors open until the statement is closed.Example:
To free the resources following code has to be executed after the outputs are retrieved:
This probably has to be implemented in following class:
org.springframework.data.jpa.repository.query.JpaQueryExecution.ProcedureExecution
see https://vladmihalcea.com/best-way-call-stored-procedure-jpa-hibernate/
I'm using spring-data-jpa 2.7.10
The text was updated successfully, but these errors were encountered: