This issue is most likely in relation to HHH-16743 Closed fixed in 6.2.5 (thank you Andrea!). When an entity with @Proxy(lazy=false) is loaded through BatchInitializeEntitySelectFetchInitializer I get a StackOverFlowError. The problem seems to persist when the entities are loaded from different paths:
- from a OneToMany
- from a collection with a SqlSelect loader
- from a Criteria query
My very limited understanding of the problem is that EntitySelectFetchInitializerBuilder.canBatchInitializeBeUsed returns true when an entity has proxies disabled AND does not have subclasses. In that case the initializer is BatchInitializeEntitySelectFetchInitializer and we get a StackOverFlowError because the initializer thinks that a proxy will be created when in reality it issues a new query. I'm not sure if this should be 3 separate issues but the symptoms seem to be the same. |