We have some code not behind a @Transactional but using ad-hoc transactions. On some weird constellation with bidirectional many-to-one and one-to-one and circular graph, we get this assertion to trigger:
The stripped-down reproducer project is here: https://github.com/ls-urs-keller/hibernate-force-initalizing-collection-problem There is a single Test class that has 2 test methods one fails the other works. I haven’t completely stripped out the spring dependencies, I hope that is OK and it won’t turn out to be a spring problem. This relates to the discussion here: https://discourse.hibernate.org/t/force-initializing-collection-loading/7172 |