Skip to content

Commit a7f017c

Browse files
committed
HHH-13307 : On release of batch it still contained JDBC statements using JTA
1 parent 1241d35 commit a7f017c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

hibernate-core/src/main/java/org/hibernate/engine/jdbc/batch/internal/AbstractBatchImpl.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,8 +159,12 @@ protected void releaseStatements() {
159159
clearBatch( statement );
160160
resourceRegistry.release( statement );
161161
}
162-
jdbcCoordinator.afterStatementExecution();
162+
// IMPL NOTE: If the statements are not cleared and JTA is being used, then
163+
// jdbcCoordinator.afterStatementExecution() will abort the batch and a
164+
// warning will be logged. To avoid the warning, clear statements first,
165+
// before calling jdbcCoordinator.afterStatementExecution().
163166
statements.clear();
167+
jdbcCoordinator.afterStatementExecution();
164168
}
165169

166170
protected void clearBatch(PreparedStatement statement) {

0 commit comments

Comments
 (0)