Yoann Rodière (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
) *created* an issue
Hibernate ORM (
https://hibernate.atlassian.net/browse/HHH?atlOrigin=eyJpIjoiYWY0YzIyYTAy...
) / Bug (
https://hibernate.atlassian.net/browse/HHH-16458?atlOrigin=eyJpIjoiYWY0Yz...
) HHH-16458 (
https://hibernate.atlassian.net/browse/HHH-16458?atlOrigin=eyJpIjoiYWY0Yz...
) JDBC statement is not closed when DeferredResultSetAccess fails to execute a query (
https://hibernate.atlassian.net/browse/HHH-16458?atlOrigin=eyJpIjoiYWY0Yz...
)
Issue Type: Bug Assignee: Yoann Rodière (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
) Components: hibernate-core Created: 12/Apr/2023 00:54 AM Fix Versions: 6.2.1 Priority:
Major Reporter: Yoann Rodière (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
)
In org.hibernate.sql.exec.internal.JdbcSelectExecutorStandardImpl#doExecuteQuery ,
DeferredResultSetAccess (and thus the underlying JDBC statement) does not get released
when resolveJdbcValuesSource throws an exception.
In practice this is not a big issue as the JDBC driver or connection pool (e.g. Agroal)
will likely close statements on connection release, but it does lead to annoying warnings
with Agroal in particular.
The leak can be reproduced for example by trying to execute specific queries in
transactions:
* a query with parameters whose type don’t match the SQL, e.g. SELECT ( :param / 2 ) with
param = "foo"
* with the MySQL JDBC driver, a query referencing tables that don’t exist (this driver
will only check this on query execution, not when preparing statements…)
See also
https://github.com/quarkusio/quarkus/issues/32539
(
https://hibernate.atlassian.net/browse/HHH-16458#add-comment?atlOrigin=ey...
) Add Comment (
https://hibernate.atlassian.net/browse/HHH-16458#add-comment?atlOrigin=ey...
)
Get Jira notifications on your phone! Download the Jira Cloud app for Android (
https://play.google.com/store/apps/details?id=com.atlassian.android.jira....
) or iOS (
https://itunes.apple.com/app/apple-store/id1006972087?pt=696495&ct=Em...
) This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100221- sha1:c4871f2 )