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 Bug
    • Status: Resolved
    • Priority: Major 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!

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

        Activity

        Mark Struberg created issue -
        Mark Struberg made changes -
        Field Original Value New Value
        Attachment OPENJPA-1913-test.patch [ 12467385 ]
        Mark Struberg made changes -
        Attachment OPENJPA-1913-enhancer-fix.patch [ 12467431 ]
        Jeremy Bauer made changes -
        Assignee Jeremy Bauer [ techhusky ]
        Albert Lee made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Fix Version/s 2.2.0 [ 12315910 ]
        Resolution Not A Problem [ 8 ]

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development