Skip to content

Commit ded1303

Browse files
committed
HHH-8210 JdbcCoordinatorImpl logs excessive warnings with some
connection pools
1 parent 77fd4d6 commit ded1303

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

hibernate-core/src/main/java/org/hibernate/engine/jdbc/internal/JdbcCoordinatorImpl.java

+6-2
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,9 @@ public void register(ResultSet resultSet, Statement statement) {
381381
}
382382
}
383383
if ( statement != null ) {
384-
if ( LOG.isEnabled( Level.WARN ) && !xref.containsKey( statement ) ) {
384+
// Keep this at DEBUG level, rather than warn. Numerous connection pool implementations can return a
385+
// proxy/wrapper around the JDBC Statement, causing excessive logging here. See HHH-8210.
386+
if ( LOG.isEnabled( Level.DEBUG ) && !xref.containsKey( statement ) ) {
385387
LOG.unregisteredStatement();
386388
}
387389
Set<ResultSet> resultSets = xref.get( statement );
@@ -407,7 +409,9 @@ public void release(ResultSet resultSet) {
407409
throw exceptionHelper.convert( e, "unable to access statement from resultset" );
408410
}
409411
if ( statement != null ) {
410-
if ( LOG.isEnabled( Level.WARN ) && !xref.containsKey( statement ) ) {
412+
// Keep this at DEBUG level, rather than warn. Numerous connection pool implementations can return a
413+
// proxy/wrapper around the JDBC Statement, causing excessive logging here. See HHH-8210.
414+
if ( LOG.isEnabled( Level.DEBUG ) && !xref.containsKey( statement ) ) {
411415
LOG.unregisteredStatement();
412416
}
413417
Set<ResultSet> resultSets = xref.get( statement );

hibernate-core/src/main/java/org/hibernate/internal/CoreMessageLogger.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -1342,7 +1342,9 @@ void unableToWriteCachedFile(String path,
13421342
@Message(value = "ResultSet had no statement associated with it, but was not yet registered", id = 386)
13431343
void unregisteredResultSetWithoutStatement();
13441344

1345-
@LogMessage(level = WARN)
1345+
// Keep this at DEBUG level, rather than warn. Numerous connection pool implementations can return a
1346+
// proxy/wrapper around the JDBC Statement, causing excessive logging here. See HHH-8210.
1347+
@LogMessage(level = DEBUG)
13461348
@Message(value = "ResultSet's statement was not registered", id = 387)
13471349
void unregisteredStatement();
13481350

0 commit comments

Comments
 (0)