HHH-13526 Optimise HashMap lookup operations on ResourceRegistryStandardImpl xref

This commit is contained in:
Sanne Grinovero 2019-07-31 10:06:29 +01:00 committed by Sanne Grinovero
parent 0f523c195a
commit 5699258aa2

View File

@ -81,18 +81,16 @@ public void register(Statement statement, boolean cancelable) {
public void release(Statement statement) { public void release(Statement statement) {
log.tracev( "Releasing statement [{0}]", statement ); log.tracev( "Releasing statement [{0}]", statement );
// Keep this at DEBUG level, rather than warn. Numerous connection pool implementations can return a final Set<ResultSet> resultSets = xref.remove( statement );
// proxy/wrapper around the JDBC Statement, causing excessive logging here. See HHH-8210. if ( resultSets != null ) {
if ( log.isDebugEnabled() && !xref.containsKey( statement ) ) { closeAll( resultSets );
log.unregisteredStatement();
} }
else { else {
final Set<ResultSet> resultSets = xref.get( statement ); // Keep this at DEBUG level, rather than warn. Numerous connection pool implementations can return a
if ( resultSets != null ) { // proxy/wrapper around the JDBC Statement, causing excessive logging here. See HHH-8210.
closeAll( resultSets ); log.unregisteredStatement();
}
xref.remove( statement );
} }
close( statement ); close( statement );
if ( lastQuery == statement ) { if ( lastQuery == statement ) {