Uploaded image for project: 'Hibernate ORM'
  1. HHH-10993

NPE when Lazy loading collection without transaction for bytecode enhanced entitie

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 5.0.9, 5.2.1
    • Fix Version/s: 5.0.10, 5.2.2, 5.1.1
    • Component/s: hibernate-core
    • Labels:
      None
    • Bug Testcase Reminder (view):

      Bug reports should generally be accompanied by a test case!

    • Last commented by a user?:
      true
    • Sprint:

      Description

      When Lazy loaded collections are accessed outside a transaction for bytecode enhanced entities, a NullPointerException is thrown by org.hibernate.engine.internal.AbstractEntityEntry.overwriteLoadedStateCollectionValue().

      This exception occurs when a Lazy Loaded collection is accessed outside a transaction, a temporary session is created to lazy load the collection and the loadedState of the EntityEntry for the PersistenceContext is set to null by;

      org.hibernate.bytecode.enhance.spi.interceptor.LazyAttributeLoadingInterceptor.loadAttribute()

      https://github.com/hibernate/hibernate-orm/blob/master/hibernate-core/src/main/java/org/hibernate/bytecode/enhance/spi/interceptor/LazyAttributeLoadingInterceptor.java#L88

      This was introduced by HHH-10708 Closed

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: