# A simple read (em.find(...)) against When batch fetching is enabled, refreshing an entity with an eager list many- a lock request seems to -one mapping will result in duplicate children objects being added to the collection. do two things incorrectly ** See attached test HibernateTests.testManyToOneEagerMapping ** *PASSES* in 5.2.18 and 5.4.1. *FAILS* in 5.3.7 and 5.4.0. # Refreshing the locked entity may still not return the The lock mode the entity was locked at. This relates does not seem to HHH-12257 which was marked as resolved for 5 be set/retained correctly . 3.0. One of the tests in the test project attached that illustrates HHH-12257 is now passing here; however, the other one still fails. ** See attached test HibernateTests.testLazyCollectionAfterBatchFetchRefreshLock ) ** *FAILS* in all versions tested the attached project . ** Note that even if the test current assertion failure is resolved in the above test , HHH-12268 will still cause this test to fail due to the exception thrown by delazifying the children; I'm aware that issue is still open. # When other entities are retrieved in the refresh, inspection of the SQL generated shows that *multiple records* are locked. It seems to me that when requesting a lock for a specific entity (even if batch fetching is enabled) only a single entity should be locked. I have attached the test project that illustrates the above issues. You can also find it on github at https://github.com/caspianb/HibernateRefreshTest [^HibernateRefreshTest.zip] |
|