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) |