Skip to content

Commit f66595f

Browse files
committed
HHH-16713 Fix number of row counts check in BatchImpl
1 parent 1945c67 commit f66595f

File tree

1 file changed

+2
-3
lines changed
  • hibernate-core/src/main/java/org/hibernate/engine/jdbc/batch/internal

1 file changed

+2
-3
lines changed

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -303,12 +303,11 @@ protected void performExecution() {
303303
private void checkRowCounts(int[] rowCounts, PreparedStatementDetails statementDetails) throws SQLException, HibernateException {
304304
final int numberOfRowCounts = rowCounts.length;
305305
if ( batchPosition != 0 ) {
306-
final int expectedNumberOfCounts = batchPosition / getStatementGroup().getNumberOfStatements();
307-
if ( numberOfRowCounts != expectedNumberOfCounts ) {
306+
if ( numberOfRowCounts != batchPosition ) {
308307
JDBC_MESSAGE_LOGGER.unexpectedRowCounts(
309308
statementDetails.getMutatingTableDetails().getTableName(),
310309
numberOfRowCounts,
311-
expectedNumberOfCounts
310+
batchPosition
312311
);
313312
}
314313
}

0 commit comments

Comments
 (0)