Uploaded image for project: 'OpenJPA'
  1. OpenJPA
  2. OPENJPA-1913

If fetch-groups is used, detaching an entity will lead to all lazy loaded members get reset to null

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Not A Problem
    • Affects Version/s: 2.1.0
    • Fix Version/s: None
    • Component/s: kernel
    • Labels:
      None

      Description

      If I use openjpa.DetachState=fetch-groups and detach an entity with a lazy loaded list, this list gets reset to null.

      An example:

      class @Entity Person {
      private String name;

      @OneToMany(mappedBy = "group", cascade =

      {CascadeType.ALL}

      )
      private List<Subscription> subscriptions = new ArrayList<Subscription>();
      ...}

      I load the Person and access the subscriptions inside a transaction. I get a person instance with e.g. 3 subscriptions.
      If I now close the EntityManager and my person gets detached, the subscriptions list is suddenly null!

        Attachments

        1. OPENJPA-1913-test.patch
          9 kB
          Mark Struberg
        2. OPENJPA-1913-enhancer-fix.patch
          2 kB
          Mark Struberg

          Activity

            People

            • Assignee:
              techhusky Jeremy Bauer
              Reporter:
              struberg Mark Struberg
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: