-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Warning JDBC resources leaked when executing StoredProcedureQuery #13273
Comments
Interesting. In my experience, Agroal is typically right - we're probably leaking a callable in ORM. |
This even seems to be an issue in the spec The workaround
works. The tracked statement is released, before the connection is closed and the leakage warning disappears.
still persists. |
I believe this would be solved by #7242 if we were to set There are, however, other aspects to this change, so I'll let the discussion continue on #7242. |
Signed-off-by: Yoann Rodière <yoann@hibernate.org>
Signed-off-by: Yoann Rodière <yoann@hibernate.org>
Signed-off-by: Yoann Rodière <yoann@hibernate.org>
Signed-off-by: Yoann Rodière <yoann@hibernate.org>
Signed-off-by: Yoann Rodière <yoann@hibernate.org>
Signed-off-by: Yoann Rodière <yoann@hibernate.org>
Signed-off-by: Yoann Rodière <yoann@hibernate.org>
Signed-off-by: Yoann Rodière <yoann@hibernate.org>
Fixed in #14305 |
Describe the bug
For legacy reasons we are using stored procedures in a Oracle DB. We are calling this procedures over an JPA
EntityManager
(EntityManager#createStoredProcedureQuery(String)
andStoredProcedureQuery#execute()
). This leads to follow warningsAs it seems upon execution a
CallableStatement
gets prepared and tracked inio.agroal.pool.wrapper.ConnectionWrapper.prepareCall(String)
. However upon commit of the transaction thisCallableStatment
isn't closed and therefore doesn't get untracked. When the connection is closed, this results in an open tracked statement inConnectionWrapper#closeTrackedStatements()
, which results in the appropriateJdbcResourcesLeakReport
and the warnings. A real resource leak imho doesn't exist, as thisCallableStatment
is closed in this method.Expected behavior
When executing a StoredProcedureQuery the prepared
CallableStatement
gets closed upon commit of the transaction.Actual behavior
The
CallableStatement
doesn't get closed upon commit of the transaction, which leads to an open tracked statement when closing the connection.To Reproduce
Maven project to reproduce:
code-with-quarkus.zip
Script for stored procedure:
procedure.zip
Steps to reproduce the behavior:
Environment (please complete the following information):
The text was updated successfully, but these errors were encountered: