Enabling Lazy Initialization in Hibernate 6.2

Solution Verified - Updated -

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.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content