Uploaded image for project: 'Causeway'
  1. Causeway
  2. CAUSEWAY-476

Update JDO/DN to allow for fact that invoking the Persisting callback may have resulted in the target object having already been updated.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • objectstore-jdo-1.1.0
    • objectstore-jdo-1.3.0
    • Persistence JDO
    • None

    Description

      This issue was found while working on Estatio app:

      public class CommunicationChannel {

      ....

      /**

      • Isis callback
        */
        public void persisting() { owner.addToCommunicationChannels(this); }

        }

      correctly generates the INSERT of the owner/CC tuple (eg into PARTY_COMMUNICATIONCHANNELS), but then Isis throws an exception.

      The fix is to add a guard in DataNucleusSimplePersistAlgorithm:

      public void makePersistent(final ObjectAdapter adapter,
      final ToPersistObjectSet toPersistObjectSet) {
      ...
      CallbackUtils.callCallback(adapter, PersistingCallbackFacet.class);
      // the callback might have caused the adapter to become persistent.
      if (alreadyPersistedOrNotPersistable(adapter))

      { return; }

      ...
      }

      Attachments

        Activity

          People

            danhaywood Daniel Keir Haywood
            danhaywood Daniel Keir Haywood
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: