OpenJPA
  1. OpenJPA
  2. OPENJPA-1983

Merge of lazily fetched fields, and merge of managed entities deviates from spec

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.1.0, 2.2.0
    • Fix Version/s: 2.0.3, 2.1.2, 2.2.0
    • Component/s: jdbc
    • Labels:
      None

      Description

      Attached is a test case that illustrates this fail (You can place it into openjpa-persistence-jdbc/src/test/java/org.apache.openjpa.persistence.merge)

      Problem 1: Section 3.2.7.1 (Merging Detached Entity State) of the specification says that "The persistence provider must not merge fields marked LAZY that have not been fetched: it must ignore such fields when merging.". The attached test case illustrates that OpenJPA 2.1.0 does not ignore fields marked LAZY that have not been fetched.
      Problem 2: In the same section, the specification says "If X is a managed entity, it is ignored by the merge operation...". But OpenJPA 2.1.0 doesn't seem to ignore them.

      1. Inner.java
        1 kB
        Pradyumna Achar
      2. OPENJPA-1983.patch
        12 kB
        Rick Curtis
      3. Outer.java
        1 kB
        Pradyumna Achar
      4. TestLazyFields.java
        3 kB
        Pradyumna Achar

        Issue Links

          Activity

          Hide
          Rick Curtis added a comment -

          Attaching a patch with the test case and code fix. I'm going to wait a couple days to commit this change till I can validate that I don't break some other tests.

          Show
          Rick Curtis added a comment - Attaching a patch with the test case and code fix. I'm going to wait a couple days to commit this change till I can validate that I don't break some other tests.
          Hide
          Rick Curtis added a comment -

          Committed revision 1095401 to trunk.

          Thanks for the thorough test case Pradyumna!

          Show
          Rick Curtis added a comment - Committed revision 1095401 to trunk. Thanks for the thorough test case Pradyumna!
          Hide
          Albert Lee added a comment -

          Close issue in preparation for 2.2.0 release.

          Show
          Albert Lee added a comment - Close issue in preparation for 2.2.0 release.
          Hide
          ASF subversion and git services added a comment -

          Commit 1504611 from Heath Thomann in branch 'openjpa/branches/2'
          [ https://svn.apache.org/r1504611 ]

          OPENJPA-1983: Don't cascade to an unloaded field when merge is called on a managed Entity - back ported Rick Curtis' trunk changes to 2.0.x.

          Show
          ASF subversion and git services added a comment - Commit 1504611 from Heath Thomann in branch 'openjpa/branches/2' [ https://svn.apache.org/r1504611 ] OPENJPA-1983 : Don't cascade to an unloaded field when merge is called on a managed Entity - back ported Rick Curtis' trunk changes to 2.0.x.
          Hide
          ASF subversion and git services added a comment -

          Commit 1504619 from Heath Thomann in branch 'openjpa/branches/2'
          [ https://svn.apache.org/r1504619 ]

          OPENJPA-1983: Don't cascade to an unloaded field when merge is called on a managed Entity - back ported Rick Curtis' trunk changes to 2.1.x.

          Show
          ASF subversion and git services added a comment - Commit 1504619 from Heath Thomann in branch 'openjpa/branches/2' [ https://svn.apache.org/r1504619 ] OPENJPA-1983 : Don't cascade to an unloaded field when merge is called on a managed Entity - back ported Rick Curtis' trunk changes to 2.1.x.

            People

            • Assignee:
              Rick Curtis
              Reporter:
              Pradyumna Achar
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development