OpenJPA
  1. OpenJPA
  2. OPENJPA-1911

InvalidStateException is thrown when merge an entity with derived identiy

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.0.4, 1.2.2, 2.0.1, 2.1.0, 2.2.0
    • Fix Version/s: 1.2.3, 1.3.0, 2.0.2, 2.1.0, 2.2.0
    • Component/s: kernel
    • Labels:
      None

      Description

      <openjpa-2.0.2-SNAPSHOT-r422266:1027632M nonfatal user error> org.apache.openjpa.persistence.InvalidStateException: Attempt to change a primary key field of an instance that already has a final object id. Only new, unflushed instances whose id you have not retrieved can have their primary keys changed.
      FailedObject: org.apache.openjpa.persistence.xs.AccountingHierarchyRate-TESTING::1
      at org.apache.openjpa.kernel.StateManagerImpl.assertNoPrimaryKeyChange(StateManagerImpl.java:2086)
      at org.apache.openjpa.kernel.StateManagerImpl.settingObjectField(StateManagerImpl.java:2020)
      at org.apache.openjpa.kernel.AttachStrategy.attachField(AttachStrategy.java:205)
      at org.apache.openjpa.kernel.VersionAttachStrategy.attach(VersionAttachStrategy.java:161)
      at org.apache.openjpa.kernel.AttachManager.attach(AttachManager.java:251)
      at org.apache.openjpa.kernel.AttachStrategy.attachCollection(AttachStrategy.java:339)
      at org.apache.openjpa.kernel.AttachStrategy.replaceList(AttachStrategy.java:399)
      at org.apache.openjpa.kernel.AttachStrategy.attachField(AttachStrategy.java:224)
      at org.apache.openjpa.kernel.VersionAttachStrategy.attach(VersionAttachStrategy.java:161)
      at org.apache.openjpa.kernel.AttachManager.attach(AttachManager.java:251)
      at org.apache.openjpa.kernel.AttachManager.attach(AttachManager.java:104)
      at org.apache.openjpa.kernel.BrokerImpl.attach(BrokerImpl.java:3400)
      at org.apache.openjpa.kernel.DelegatingBroker.attach(DelegatingBroker.java:1206)
      at org.apache.openjpa.persistence.EntityManagerImpl.merge(EntityManagerImpl.java:871)
      at org.apache.openjpa.persistence.xs.TestMergeComplexKey.test(TestMergeComplexKey.java:29)

      1. OPENJPA-1911-2.0.x.patch
        18 kB
        Heath Thomann
      2. OPENJPA-1911-1.3.x.patch
        18 kB
        Heath Thomann
      3. OPENJPA-1911-1.2.x.patch
        18 kB
        Heath Thomann

        Activity

        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open Resolved Resolved
        43m 6s 1 Fay Wang 03/Jan/11 19:34
        Resolved Resolved Closed Closed
        8s 1 Fay Wang 03/Jan/11 19:34
        Closed Closed Reopened Reopened
        38d 2h 11m 1 Michael Dick 10/Feb/11 21:45
        Reopened Reopened Closed Closed
        4d 23h 15m 1 Michael Dick 15/Feb/11 21:01
        Michael Dick made changes -
        Status Reopened [ 4 ] Closed [ 6 ]
        Resolution Fixed [ 1 ]
        Michael Dick made changes -
        Fix Version/s 1.2.3 [ 12314517 ]
        Fix Version/s 1.3.0 [ 12313326 ]
        Fix Version/s 2.0.2 [ 12315257 ]
        Affects Version/s 2.0.1 [ 12314532 ]
        Affects Version/s 1.2.2 [ 12313681 ]
        Affects Version/s 1.0.4 [ 12313301 ]
        Affects Version/s 2.0.2 [ 12315257 ]
        Michael Dick made changes -
        Resolution Fixed [ 1 ]
        Status Closed [ 6 ] Reopened [ 4 ]
        Heath Thomann made changes -
        Attachment OPENJPA-1911-1.2.x.patch [ 12468860 ]
        Attachment OPENJPA-1911-1.3.x.patch [ 12468861 ]
        Attachment OPENJPA-1911-2.0.x.patch [ 12468862 ]
        Hide
        Heath Thomann added a comment -

        Attaching patches for 1.2.x, 1.3.x, and 2.0.x.

        Thanks,

        Heath

        Show
        Heath Thomann added a comment - Attaching patches for 1.2.x, 1.3.x, and 2.0.x. Thanks, Heath
        Rick Curtis made changes -
        Fix Version/s 2.1.0 [ 12314542 ]
        Affects Version/s 2.0.2 [ 12315257 ]
        Affects Version/s 2.1.0 [ 12314542 ]
        Fay Wang made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Fay Wang made changes -
        Field Original Value New Value
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Fay Wang created issue -

          People

          • Assignee:
            Fay Wang
            Reporter:
            Fay Wang
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development