When batching is turned on for entities that update multiple tables when updated following warn is logged:
{{HHH100001: JDBC driver did not return the expected number of row counts}}
Problem is in {{org.hibernate.engine.jdbc.batch.internal.BatchImpl.checkRowCounts}} when determining {{expectedNumberOfCounts}}. In case when we are updating one entity (which will set {{batchPosition}} to 1 ) which for example extends entity with inheritance strategy set to {{InheritanceType.JOINED}} , thus creating two update statements to be executed in DB, {{expectedNumberOfCounts}} will be wrongfully determined to be 0 (1/2) and warning will be logged. This is definitely wrong. Also in {{org.hibernate.engine.jdbc.batch.internal.BatchImpl.checkRowCounts }} when logging warning expected and actual are switched. Attached test case produces warning, see the console after execution
Edit: One more thing, in example described above (first entity inheriting other via {{InheritanceType.JOINED}} …) {{org.hibernate.engine.jdbc.batch.internal.BatchImpl.checkRowCounts}} is called only for identifier table of entity being updated , it seems that it should be called a second time for superclass entity all affected tables . |
|