OpenJPA
  1. OpenJPA
  2. OPENJPA-732

Updates to entities via Lifecycle callback methods

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.2.1, 1.3.0
    • Fix Version/s: 1.2.2, 2.0.0-M2
    • Component/s: kernel
    • Labels:
      None

      Description

      http://n2.nabble.com/Updates-to-entities-via-Lifecycle-callback-methods-td1110631.html

      In a nutshell, if we are to allow the updating of the entities passed into the Lifecycle callback methods, then we have a couple of problems (given the scenario of updating the entity passed into the @PreUpdate method):

      o The designated @Version field is getting updated more often than desired causing the transaction to rollback.
      o The @PostUpdate method is getting invoked more than once.

      I will post a testcase shortly. If and when we decide to fix this, this simple testcase will need to be expanded to include the updating of entities in other scenarios as well.

      I am also getting verification from the JPA Expert Group as to whether these entities are supposed to be updatable or not. As one of the dev postings indicated, our OpenJPA documentation indicates that they are updatable. But, the JPA spec itself is not clear on this capability. Other vendors, such as Hibernate, allow for this.

      1. openjpa-732-test.zip
        6 kB
        Kevin Sutter
      2. OPENJPA-732-1.2.patch
        22 kB
        B.J. Reed
      3. OPENJPA-732-1.0.patch
        22 kB
        B.J. Reed

        Issue Links

          Activity

          Transition Time In Source Status Execution Times Last Executer Last Execution Date
          Open Open Resolved Resolved
          9d 51m 1 Albert Lee 02/Oct/08 21:42
          Resolved Resolved Reopened Reopened
          2h 8m 1 Albert Lee 02/Oct/08 23:51
          Reopened Reopened Resolved Resolved
          26d 20h 14m 1 Albert Lee 29/Oct/08 19:06
          Resolved Resolved Closed Closed
          2h 24m 1 Albert Lee 29/Oct/08 21:30
          Donald Woods made changes -
          Fix Version/s 1.2.2 [ 12313681 ]
          Fix Version/s 1.3.0 [ 12313326 ]
          Hide
          Donald Woods added a comment -

          was fixed in 1.2.2 and trunk, not 1.3.0

          Show
          Donald Woods added a comment - was fixed in 1.2.2 and trunk, not 1.3.0
          B.J. Reed made changes -
          Attachment OPENJPA-732-1.2.patch [ 12413031 ]
          B.J. Reed made changes -
          Attachment OPENJPA-732-1.0.patch [ 12413030 ]
          B.J. Reed made changes -
          Attachment OPENJPA-732-1.2.patch [ 12413053 ]
          Attachment OPENJPA-732-1.0.patch [ 12413052 ]
          Hide
          B.J. Reed added a comment -

          Patches broke some other test cases...changing HashSet to LinkedHashSet (like current trunk version of BrokerImpl) fixes these

          Show
          B.J. Reed added a comment - Patches broke some other test cases...changing HashSet to LinkedHashSet (like current trunk version of BrokerImpl) fixes these
          Michael Dick made changes -
          Link This issue is cloned as OPENJPA-327 [ OPENJPA-327 ]
          Michael Dick made changes -
          Link This issue incorporates OPENJPA-327 [ OPENJPA-327 ]
          Michael Dick made changes -
          Attachment OPENJPA-732-1.0.patch [ 12413030 ]
          Attachment OPENJPA-732-1.2.patch [ 12413031 ]
          Hide
          Michael Dick added a comment -

          Re-attaching patches provided by B.J. Reed for issue OPENJPA-327. As it turns out the same fix resolves both issues and I'd like to use a single JIRA issue for tracking.

          Show
          Michael Dick added a comment - Re-attaching patches provided by B.J. Reed for issue OPENJPA-327 . As it turns out the same fix resolves both issues and I'd like to use a single JIRA issue for tracking.
          Michael Dick made changes -
          Link This issue relates to OPENJPA-1092 [ OPENJPA-1092 ]
          Albert Lee made changes -
          Status Resolved [ 5 ] Closed [ 6 ]
          Albert Lee made changes -
          Status Reopened [ 4 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]
          Fix Version/s 2.0.0 [ 12313483 ]
          Albert Lee made changes -
          Status Resolved [ 5 ] Reopened [ 4 ]
          Resolution Fixed [ 1 ]
          Hide
          Albert Lee added a comment -

          Reopen issue due to test regression.

          Show
          Albert Lee added a comment - Reopen issue due to test regression.
          Albert Lee made changes -
          Resolution Fixed [ 1 ]
          Fix Version/s 1.3.0 [ 12313326 ]
          Status Open [ 1 ] Resolved [ 5 ]
          Kevin Sutter made changes -
          Assignee Albert Lee [ allee8285 ]
          Kevin Sutter made changes -
          Field Original Value New Value
          Attachment openjpa-732-test.zip [ 12390781 ]
          Hide
          Kevin Sutter added a comment -

          Testcase for this JIRA Issue.

          Show
          Kevin Sutter added a comment - Testcase for this JIRA Issue.
          Kevin Sutter created issue -

            People

            • Assignee:
              Albert Lee
              Reporter:
              Kevin Sutter
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development