This is the same issue as [https://hibernate.atlassian.net/browse/HHH-16553|https://hibernate.atlassian.net/browse/HHH-16553|smart-link] but with a better understading of the problem.
I incorrectly assumed that the stackoverflow happened because the graph of entities was too deep, but the actual problem is that Hibernate tries to load the same entity over and over again.
This also seems to happen only when the entity is cacheable (and the correspoding entry must be absent from the cache so a query is necessary).
Maybe the issue is that {{BatchInitializeEntitySelectFetchInitializer}} does not handle the case when the entity is annotated with {{@Proxy( lazy=false )}}
Pull request with a test case reproducing the issue: [https://github.com/hibernate/hibernate-orm/pull/6716|https://github.com/hibernate/hibernate-orm/pull/6716|smart-link] |
|