Bug 69206 - jdbc-pool is not returning the proxied Statement from a ResultSet
Summary: jdbc-pool is not returning the proxied Statement from a ResultSet
Status: RESOLVED FIXED
Alias: None
Product: Tomcat Modules
Classification: Unclassified
Component: jdbc-pool (show other bugs)
Version: unspecified
Hardware: All All
: P2 normal (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
: 65347 (view as bug list)
Depends on:
Blocks:
 
Reported: 2024-07-18 15:46 UTC by Michael Clarke
Modified: 2024-07-23 09:28 UTC (History)
1 user (show)



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Clarke 2024-07-18 15:46:20 UTC
The proxy ResultSet returned from any of the Statement/PreparedStatement/CallableStatement implementations (executeQuery, getResultSet, getGeneratedKeys) does not intercept the getStatement call in the returned ResultSet, so the un-proxied statement is leaked to the caller.

This was discovered as part of https://hibernate.atlassian.net/browse/HHH-18325 which has highlighted that the 'equals' checks in the proxied Statement do not take into account a call to perform a comparison with a non-proxied object (e.g. performing `proxiedStatement.equals(proxiedStatement.getResultSet().getStatement())` throws an exception rather than returning a true/false value).
Comment 1 Michael Clarke 2024-07-18 16:13:54 UTC
Proposed fix: https://github.com/apache/tomcat/pull/742
Comment 2 Mark Thomas 2024-07-23 07:53:20 UTC
*** Bug 65347 has been marked as a duplicate of this bug. ***
Comment 3 Mark Thomas 2024-07-23 09:28:27 UTC
Fixed in:
- 11.0.x for 11.0.0-M23 onwards
- 10.1.x for 10.1.27 onwards
-  9.0.x for  9.0.92 onwards