mirror of
https://github.com/hibernate/hibernate-orm
synced 2025-02-08 04:08:19 +00:00
HHH-9174 Increase performance
of SqlExceptionHelper#handleAndClearWarnings Conflicts: hibernate-core/src/main/java/org/hibernate/engine/jdbc/spi/SqlExceptionHelper.java
This commit is contained in:
parent
457937885b
commit
26c7400c0a
@ -313,13 +313,18 @@ public void handleAndClearWarnings(
|
|||||||
public void handleAndClearWarnings(
|
public void handleAndClearWarnings(
|
||||||
Statement statement,
|
Statement statement,
|
||||||
WarningHandler handler) {
|
WarningHandler handler) {
|
||||||
try {
|
// See HHH-9174. Statement#getWarnings can be an expensive call for many JDBC libs. Don't do it unless
|
||||||
walkWarnings( statement.getWarnings(), handler );
|
// the log level would actually allow a warning to be logged.
|
||||||
}
|
if (LOG.isEnabled(Level.WARN)) {
|
||||||
catch (SQLException sqlException) {
|
try {
|
||||||
// workaround for WebLogic
|
walkWarnings( statement.getWarnings(), handler );
|
||||||
LOG.debug( "could not log warnings", sqlException );
|
}
|
||||||
}
|
catch (SQLException sqlException) {
|
||||||
|
// workaround for WebLogic
|
||||||
|
LOG.debug( "could not log warnings", sqlException );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// Sybase fail if we don't do that, sigh...
|
// Sybase fail if we don't do that, sigh...
|
||||||
statement.clearWarnings();
|
statement.clearWarnings();
|
||||||
@ -328,5 +333,4 @@ public void handleAndClearWarnings(
|
|||||||
LOG.debug( "could not clear warnings", sqle );
|
LOG.debug( "could not clear warnings", sqle );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user