HHH-16713 Fix number of row counts check in BatchImpl

This commit is contained in:
Marco Belladelli 2023-06-15 10:35:28 +02:00
parent de5987b3b3
commit 9dca8f084b
1 changed files with 2 additions and 3 deletions

View File

@ -303,12 +303,11 @@ public class BatchImpl implements Batch {
private void checkRowCounts(int[] rowCounts, PreparedStatementDetails statementDetails) throws SQLException, HibernateException {
final int numberOfRowCounts = rowCounts.length;
if ( batchPosition != 0 ) {
final int expectedNumberOfCounts = batchPosition / getStatementGroup().getNumberOfStatements();
if ( numberOfRowCounts != expectedNumberOfCounts ) {
if ( numberOfRowCounts != batchPosition ) {
JDBC_MESSAGE_LOGGER.unexpectedRowCounts(
statementDetails.getMutatingTableDetails().getTableName(),
numberOfRowCounts,
expectedNumberOfCounts
batchPosition
);
}
}