Uploaded image for project: 'JDO'
  1. JDO
  2. JDO-747

Behavior of delete() with multiple concurrent Transactions

    XMLWordPrintableJSON

Details

    Description

      In the Spec I could not find any statement regarding on how a transaction should behave if an object is deleted in a different concurrent transaction.

      Related Sections are Section 5.8 (how different methods should behave for different object states) and Section 12.6.1 (the behavior of refresh() and related methods).

      For example I wonder about the following situations. Suppose I have two optimistic sessions, pm1 and pm2, both access the same object. pm1 deletes the object and commits. Then what happens in pm2 if:

      1. pm2 deletes the object and tries to commit, should that work? It's
      wouldn't be a real conflict if both delete it.

      2. pm2 modifies the object (make dirty) and calls refresh(). Should I
      get an ObjectNotFound exception?

      3. pm2 deletes the object and calls refresh(). According to the spec,
      refresh() should not change the object's state. But should it
      still fail with ObjectNotFound? If refresh should fail, how can I
      ever recover from such a situation, because I can't undelete the
      object?

      Is there a common understanding how this should work?
      IF there an external definition JDO relies on, then I think a reference to an external document might useful.
      If not, should the Spec define concurrent behavior?

      Attachments

        1. StateTransitionPatch_JDO747_v6.txt
          10 kB
          Tilmann Zäschke
        2. OptimisticFailurePatch_JDO747.txt
          5 kB
          Tilmann Zäschke
        3. OptimisticCheckConsistency.java
          10 kB
          Tilmann Zäschke
        4. JDO-StateTransition-logs-2015-12-04.zip
          480 kB
          Tilmann Zäschke
        5. Ch12-PersistenceManager-With-747-Changes-Marked.odt
          58 kB
          Tilmann Zäschke
        6. Ch12-PersistenceManager-With-747.odt
          73 kB
          Tilmann Zäschke
        7. Ch05-LifeCycle-With-747.odt
          81 kB
          Tilmann Zäschke

        Issue Links

          Activity

            People

              tilmann Tilmann Zäschke
              tilmann Tilmann Zäschke
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated: