One more Unexpected warning: "HHH100001: JDBC driver did not return the expected number of row counts"
Description
Attachments
1
relates to
Activity
Show:

Tim Prijn January 17, 2025 at 5:36 PM
I noticed that I’ve created the issue with priority major. I believe priority shouldn’t be major, but I don’t know how to fix that (or if i am authorized to).
Details
Details
Assignee
Unassigned
UnassignedReporter

Priority
Created January 17, 2025 at 5:32 PM
Updated January 17, 2025 at 5:40 PM
Our logging contained the WARN “HHH100001”. The following issue https://hibernate.atlassian.net/browse/HHH-16713 which has been fixed, describes the same problem. It, however, seems that there's one more situation in which this WARN log statement is produced and it probably shouldn't.
Attached you'll find the file BatchRowCountWarningTest.java with an extra test added, named testUpdateMultipleJoinedMyEntityAttributeChangedAndSubEntityAttributeChanged. This additional test produces the WARN log (and fails). As you'll see two MyEntity instances are being updated. The first instance update is changing the subclass (and thus an attribute in the myentity table). The update of the second instance changes the baseName attribute of the BaseEntity (and corresponding table). I believe the WARN log is incorrect.
Furthermore I noticed that the log statement indicates a wrong rowcount. Isn't this a bit confusing considering rowcount.length is used? Doesn't The rowcount.length say more about the number of commands executed in the batch (as per Javadoc of Statement.executeBatch)? The batchPosition also represents the number added commands to the batch, before executing (I think).