Uploaded image for project: 'JBoss Enterprise Application Platform'
  1. JBoss Enterprise Application Platform
  2. JBEAP-15913

[GSS](7.1.z) HHH-12054 LazyPropertyInitializer$1 cannot be cast to [B on compile time enhanced composed entities

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Major Major
    • None
    • 7.1.5.GA
    • Hibernate
    • None
    • Hide

      mvn clean install using attached test case.
      In the attached pom.xml if Hibernate Core is set to <version>5.3.6.Final</version> test succeeds

      Show
      mvn clean install using attached test case. In the attached pom.xml if Hibernate Core is set to <version>5.3.6.Final</version> test succeeds

      This seems to be a regression as the issue was fixed in EAP 6.4.5 ref HHH-5255

      Writing to a lazy loaded lob property of an entity leads to a ClassCastException during transaction commit when the lob property has not been accessed / lazily loaded before writing to it. The entity is annotated as follows

      @Basic(fetch=FetchType.LAZY)
      @LazyGroup("smallBlob")
      @LazyToOne(LazyToOneOption.NO_PROXY)
      Raw

      • * Resulting exception
        Raw
        java.lang.ClassCastException: org.hibernate.bytecode.enhance.spi.LazyPropertyInitializer$1 cannot be cast to java.sql.Blob
        at org.hibernate.type.descriptor.java.BlobTypeDescriptor.areEqual(BlobTypeDescriptor.java:33)
        at org.hibernate.type.AbstractStandardBasicType.isEqual(AbstractStandardBasicType.java:180)
        at org.hibernate.type.AbstractStandardBasicType.isSame(AbstractStandardBasicType.java:170)
        at org.hibernate.type.AbstractStandardBasicType.isDirty(AbstractStandardBasicType.java:206)
        at org.hibernate.type.AbstractStandardBasicType.isDirty(AbstractStandardBasicType.java:202)
        at org.hibernate.type.TypeHelper.findDirty(TypeHelper.java:322)
        at org.hibernate.persister.entity.AbstractEntityPersister.findDirty(AbstractEntityPersister.java:4218)
        at org.hibernate.event.internal.DefaultFlushEntityEventListener.dirtyCheck(DefaultFlushEntityEventListener.java:528)
        at org.hibernate.event.internal.DefaultFlushEntityEventListener.isUpdateNecessary(DefaultFlushEntityEventListener.java:215)
        at org.hibernate.event.internal.DefaultFlushEntityEventListener.onFlushEntity(DefaultFlushEntityEventListener.java:142)
        at org.hibernate.event.internal.AbstractFlushingEventListener.flushEntities(AbstractFlushingEventListener.java:216)
        at org.hibernate.event.internal.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:85)
        at org.hibernate.event.internal.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:38)
        at org.hibernate.internal.SessionImpl.flush(SessionImpl.java:1295)
        at org.hibernate.internal.SessionImpl.managedFlush(SessionImpl.java:468)
        at org.hibernate.internal.SessionImpl.flushBeforeTransactionCompletion(SessionImpl.java:3159)
        at org.hibernate.internal.SessionImpl.beforeTransactionCompletion(SessionImpl.java:2352)

              gbadner@redhat.com Gail Badner (Inactive)
              rhn-support-lakagwu Lami Akagwu
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: