HHH-13307 : On release of batch it still contained JDBC statements using JTA

This commit is contained in:
Gail Badner 2019-10-30 16:32:05 -07:00 committed by gbadner
parent 1241d35a50
commit a7f017c3dc
1 changed files with 5 additions and 1 deletions

View File

@ -159,8 +159,12 @@ public abstract class AbstractBatchImpl implements Batch {
clearBatch( statement );
resourceRegistry.release( statement );
}
jdbcCoordinator.afterStatementExecution();
// IMPL NOTE: If the statements are not cleared and JTA is being used, then
// jdbcCoordinator.afterStatementExecution() will abort the batch and a
// warning will be logged. To avoid the warning, clear statements first,
// before calling jdbcCoordinator.afterStatementExecution().
statements.clear();
jdbcCoordinator.afterStatementExecution();
}
protected void clearBatch(PreparedStatement statement) {