Skip to content

Commit 3e8f750

Browse files
nathan.xugavinking
authored andcommitted
HHH-18385 Remove java.sql.Statement logging in SqlStatementLogger
1 parent 7c594d1 commit 3e8f750

File tree

2 files changed

+2
-85
lines changed

2 files changed

+2
-85
lines changed

hibernate-core/src/main/java/org/hibernate/engine/jdbc/spi/SqlStatementLogger.java

Lines changed: 2 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,17 @@
66
*/
77
package org.hibernate.engine.jdbc.spi;
88

9+
import java.util.concurrent.TimeUnit;
10+
911
import org.hibernate.engine.jdbc.internal.FormatStyle;
1012
import org.hibernate.engine.jdbc.internal.Formatter;
1113
import org.hibernate.internal.CoreLogging;
1214
import org.hibernate.internal.build.AllowSysOut;
1315
import org.hibernate.resource.jdbc.spi.JdbcSessionContext;
1416
import org.hibernate.service.Service;
15-
1617
import org.hibernate.stat.spi.StatisticsImplementor;
1718
import org.jboss.logging.Logger;
1819

19-
import java.sql.Statement;
20-
import java.util.concurrent.TimeUnit;
21-
import java.util.function.Supplier;
22-
2320
/**
2421
* Centralize logging for SQL statements.
2522
*
@@ -139,28 +136,6 @@ public void logStatement(String statement, Formatter formatter) {
139136
}
140137
}
141138

142-
/**
143-
* Log a slow SQL query
144-
*
145-
* @param statement SQL statement.
146-
* @param startTimeNanos Start time in nanoseconds.
147-
*/
148-
public void logSlowQuery(final Statement statement, final long startTimeNanos, final JdbcSessionContext context) {
149-
if ( logSlowQuery < 1 ) {
150-
return;
151-
}
152-
if ( startTimeNanos <= 0 ) {
153-
throw new IllegalArgumentException( "startTimeNanos [" + startTimeNanos + "] should be greater than 0" );
154-
}
155-
156-
final long queryExecutionMillis = elapsedFrom( startTimeNanos );
157-
158-
if ( queryExecutionMillis > logSlowQuery ) {
159-
final String sql = statement.toString();
160-
logSlowQueryInternal( context, queryExecutionMillis, sql );
161-
}
162-
}
163-
164139
/**
165140
* Log a slow SQL query
166141
*

hibernate-core/src/test/java/org/hibernate/engine/jdbc/spi/SqlStatementLoggerTest.java

Lines changed: 0 additions & 58 deletions
This file was deleted.

0 commit comments

Comments
 (0)