Skip to content

Commit

Permalink
HHH-13526 Optimise HashMap lookup operations on ResourceRegistryStand…
Browse files Browse the repository at this point in the history
…ardImpl xref
  • Loading branch information
Sanne committed Aug 1, 2019
1 parent 0f523c1 commit 5699258
Showing 1 changed file with 7 additions and 9 deletions.
Expand Up @@ -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 ) {
Expand Down

0 comments on commit 5699258

Please sign in to comment.