HHH-13528 Invoke afterStatements only at the end of releasing all statements for a batch
This commit is contained in:
parent
51c94121cb
commit
2c304a5e18
|
@ -21,6 +21,7 @@ import org.hibernate.engine.jdbc.spi.JdbcServices;
|
|||
import org.hibernate.engine.jdbc.spi.SqlExceptionHelper;
|
||||
import org.hibernate.engine.jdbc.spi.SqlStatementLogger;
|
||||
import org.hibernate.internal.CoreMessageLogger;
|
||||
import org.hibernate.resource.jdbc.ResourceRegistry;
|
||||
|
||||
/**
|
||||
* Convenience base class for implementers of the Batch interface.
|
||||
|
@ -152,12 +153,14 @@ public abstract class AbstractBatchImpl implements Batch {
|
|||
}
|
||||
|
||||
protected void releaseStatements() {
|
||||
for ( PreparedStatement statement : getStatements().values() ) {
|
||||
final LinkedHashMap<String, PreparedStatement> statements = getStatements();
|
||||
final ResourceRegistry resourceRegistry = jdbcCoordinator.getResourceRegistry();
|
||||
for ( PreparedStatement statement : statements.values() ) {
|
||||
clearBatch( statement );
|
||||
jdbcCoordinator.getResourceRegistry().release( statement );
|
||||
jdbcCoordinator.afterStatementExecution();
|
||||
resourceRegistry.release( statement );
|
||||
}
|
||||
getStatements().clear();
|
||||
jdbcCoordinator.afterStatementExecution();
|
||||
statements.clear();
|
||||
}
|
||||
|
||||
protected void clearBatch(PreparedStatement statement) {
|
||||
|
|
Loading…
Reference in New Issue