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 7d54b59743
commit 68b1b650e9
1 changed files with 7 additions and 9 deletions

View File

@ -81,18 +81,16 @@ public class ResourceRegistryStandardImpl implements ResourceRegistry {
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();
}
else {
final Set<ResultSet> resultSets = xref.get( statement );
final Set<ResultSet> resultSets = xref.remove( statement );
if ( resultSets != null ) {
closeAll( resultSets );
}
xref.remove( statement );
else {
// 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 ) {