Enabling Lazy Initialization in Hibernate 6.2
Issue
The @Basic(fetch = FetchType.LAZY)
annotation, used to lazily load a byte[] Data
attribute in an entity, no longer works as expected after migrating from EAP 7.x to EAP 8.
Despite enabling lazy initialization
in persistence.xml
with <property name="hibernate.enhancer.enableLazyInitialization" value="true"/>
, the attribute is always eagerly loaded in EAP 8.
Environment
- Red Hat JBoss Enterprise Application Platform (EAP) 8
- Hibernate 6.2
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.