HHH-8983 log/clear Statement warnings on JdbcCoordinator#release
This commit is contained in:
parent
0dc24f1081
commit
a7b4d6dcb2
|
@ -524,6 +524,10 @@ public class JdbcCoordinatorImpl implements JdbcCoordinator {
|
||||||
protected void close(Statement statement) {
|
protected void close(Statement statement) {
|
||||||
LOG.tracev( "Closing prepared statement [{0}]", statement );
|
LOG.tracev( "Closing prepared statement [{0}]", statement );
|
||||||
|
|
||||||
|
// Important for Statement caching -- some DBs (especially Sybase) log warnings on every Statement under
|
||||||
|
// certain situations.
|
||||||
|
sqlExceptionHelper().logAndClearWarnings( statement );
|
||||||
|
|
||||||
if ( statement instanceof InvalidatableWrapper ) {
|
if ( statement instanceof InvalidatableWrapper ) {
|
||||||
final InvalidatableWrapper<Statement> wrapper = (InvalidatableWrapper<Statement>) statement;
|
final InvalidatableWrapper<Statement> wrapper = (InvalidatableWrapper<Statement>) statement;
|
||||||
close( wrapper.getWrappedObject() );
|
close( wrapper.getWrappedObject() );
|
||||||
|
|
|
@ -269,6 +269,10 @@ public class SqlExceptionHelper {
|
||||||
handleAndClearWarnings( connection, STANDARD_WARNING_HANDLER );
|
handleAndClearWarnings( connection, STANDARD_WARNING_HANDLER );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void logAndClearWarnings(Statement statement) {
|
||||||
|
handleAndClearWarnings( statement, STANDARD_WARNING_HANDLER );
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* General purpose handling of warnings associated with a JDBC {@link Connection}.
|
* General purpose handling of warnings associated with a JDBC {@link Connection}.
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in New Issue