-
Bug
-
Resolution: Done
-
Blocker
-
None
-
None
Hibernate ORM 5.1 introduced a new feature to enable multi-loading entities, HHH-7572. [1]
This feature has some bugs that are fixed upstream in 5.2.2 that have not been backported to 5.1:
- HHH-10617 : Returns results in the same order as specified IDs [2]
- HHH-10984 : Have multiLoad not return (unflushed) DELETED entities [3]
Without these bugfixes, results that are returned are surprising for the following reasons:
- the returned list of results does not correspond to the list of specified IDs;
- the resulting list can have a different length from the list of specified IDs;
- the resulting list excludes results for entities that don't exist (instead of a null value that corresponds to the specified ID);
- the resulting list can contain duplicated entities that are not due to duplicated IDs being specified; instead, duplicates are due to left outer joins;
- the resulting list can contain (non-flushed) deleted entities.
The main reason I think this could be a blocker is that returning a deleted entity could corrupt data, depending on what the application ultimately does with the deleted entity.
The fix for HHH-10617/HHH-10984 changes the default by making the resulting List as expected: the i-th entity returned corresponds with the i-th specified ID, or null when that entity does not exist or has been deleted (regardless of whether this operation was flushed).
[1] https://hibernate.atlassian.net/browse/HHH-7572
[2] https://hibernate.atlassian.net/browse/HHH-10617
[3] https://hibernate.atlassian.net/browse/HHH-10984
- is incorporated by
-
JBEAP-12315 Upgrade to Hibernate ORM 5.1.10
- Closed