mirror of
https://github.com/hibernate/hibernate-orm
synced 2025-02-09 12:44:49 +00:00
HHH-13526 Optimise HashMap lookup operations on ResourceRegistryStandardImpl xref
This commit is contained in:
parent
0f523c195a
commit
5699258aa2
@ -81,18 +81,16 @@ public void register(Statement statement, boolean cancelable) {
|
||||
public void release(Statement statement) {
|
||||
log.tracev( "Releasing statement [{0}]", statement );
|
||||
|
||||
// Keep this at DEBUG level, rather than warn. Numerous connection pool implementations can return a
|
||||
// proxy/wrapper around the JDBC Statement, causing excessive logging here. See HHH-8210.
|
||||
if ( log.isDebugEnabled() && !xref.containsKey( statement ) ) {
|
||||
log.unregisteredStatement();
|
||||
final Set<ResultSet> resultSets = xref.remove( statement );
|
||||
if ( resultSets != null ) {
|
||||
closeAll( resultSets );
|
||||
}
|
||||
else {
|
||||
final Set<ResultSet> resultSets = xref.get( statement );
|
||||
if ( resultSets != null ) {
|
||||
closeAll( resultSets );
|
||||
}
|
||||
xref.remove( statement );
|
||||
// Keep this at DEBUG level, rather than warn. Numerous connection pool implementations can return a
|
||||
// proxy/wrapper around the JDBC Statement, causing excessive logging here. See HHH-8210.
|
||||
log.unregisteredStatement();
|
||||
}
|
||||
|
||||
close( statement );
|
||||
|
||||
if ( lastQuery == statement ) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user