IllegalArgumentException Pulling Object From Cache with Uninitialized lazy property

Description

Test case: https://github.com/jasonparallel/hibernate-test-case-templates/blob/master/orm/hibernate-orm-5/src/test/java/org/hibernate/bugs/JPAUnitTestCase.java

Setup object in cache without lazy property initialized. When Object is pulled from cache there is no check if it is uninitialized.

java.lang.IllegalArgumentException: Value was not an array [org.hibernate.bytecode.enhance.spi.LazyPropertyInitializer$1]
at org.hibernate.type.descriptor.java.ArrayMutabilityPlan.deepCopyNotNull(ArrayMutabilityPlan.java:23)
at org.hibernate.type.descriptor.java.MutableMutabilityPlan.deepCopy(MutableMutabilityPlan.java:35)
at org.hibernate.type.descriptor.java.MutableMutabilityPlan.assemble(MutableMutabilityPlan.java:30)
at org.hibernate.type.AbstractStandardBasicType.assemble(AbstractStandardBasicType.java:323)
at org.hibernate.persister.entity.AbstractEntityPersister.initializeLazyPropertiesFromCache(AbstractEntityPersister.java:1153)
at org.hibernate.persister.entity.AbstractEntityPersister.initializeLazyProperty(AbstractEntityPersister.java:994)
at org.hibernate.bytecode.enhance.spi.interceptor.LazyAttributeLoadingInterceptor$1.doWork(LazyAttributeLoadingInterceptor.java:105)
at org.hibernate.bytecode.enhance.spi.interceptor.Helper.performWork(Helper.java:97)
at org.hibernate.bytecode.enhance.spi.interceptor.LazyAttributeLoadingInterceptor.loadAttribute(LazyAttributeLoadingInterceptor.java:76)
at org.hibernate.bytecode.enhance.spi.interceptor.LazyAttributeLoadingInterceptor.fetchAttribute(LazyAttributeLoadingInterceptor.java:72)
at org.hibernate.bytecode.enhance.spi.interceptor.LazyAttributeLoadingInterceptor.intercept(LazyAttributeLoadingInterceptor.java:61)
at org.hibernate.bytecode.enhance.spi.interceptor.LazyAttributeLoadingInterceptor.readObject(LazyAttributeLoadingInterceptor.java:296)
at org.hibernate.bugs.Image.$$_hibernate_read_content(Image.java)
at org.hibernate.bugs.Image.getContent(Image.java:36)
at org.hibernate.bugs.JPAUnitTestCase.hhh123Test(JPAUnitTestCase.java:73)

Environment

None

Activity

Show:
Aaron Schmischke
April 4, 2018, 7:19 AM

Seems to be the same problem I encountered (HHH-11766).
A patch that fixed the issue for us is attached there, although we did decide against using a patched fork and are using a workaround for now.

Tomas Lamr
April 10, 2018, 10:19 AM

Hi guys! We are also affected by this issue, any plans to merge the patch above?

Thank you for all your hard work!

Aaron Schmischke
April 10, 2018, 10:33 AM

@Lamr I suggest upvoting the issues. The hibernate folks consider those to determine priority of issues.

Gail Badner
April 18, 2018, 7:44 AM

Duplicates HHH-11766. A PR has been created for that issue.

Assignee

Gail Badner

Reporter

JasonS

Fix versions

None

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Affects versions

Priority

Major
Configure