Uploaded image for project: 'Cayenne'
  1. Cayenne
  2. CAY-512

Keep DataObjects in commited state for no-op writeProperties

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 1.2 branch
    • Undefined future
    • Core Library
    • None
    • M9-B1

    Description

      Regression: Cayenne M9+ sets DataObjects as "modified" during no-op writeProperties

      writeProperty("x", "y") puts dataObject into a modified state when "y" was already the value of "x" before the method call.

      Before M9, object would remain in committed state.

      Object in my ObjectStore:

      <ObjectId:Announcement, ANNOUNCEMENT_ID=200>=

      {<ObjectId:Announcement, ANNOUNCEMENT_ID=200>; modified; [enabled=>Y; description=>SNAP; contentList=>(..); effectiveEndDate=>Mon Oct 31 00:00:00 EST 2005; effectiveStartDate=>Thu Sep 01 00:00:00 EDT 2005; qualifiedViewpointList=>(..)]}

      ObjectDiff of record – appears to indicate that nothing has changed.
      Same as the other 4 restored objects.

      Comparision of snapshot values to object store values shows nothing different.

      value= ObjectDiff (id=3310)
      arcSnapshot= HashMap (id=3311)
      currentArcSnapshot= null
      diffId= 1
      flatIds= null
      nodeId= ObjectId (id=3309)
      objectStore= ObjectStore (id=3200)
      otherDiffs= null
      snapshot= HashMap (id=3312)

      org.objectstyle.cayenne.access.ObjectDiff@133d68a
      {}
      null
      1
      null
      <ObjectId:Announcement, ANNOUNCEMENT_ID=200>
      org.objectstyle.cayenne.access.ObjectStore@c0cf
      null

      {enabled=Y, description=SNAP, effectiveEndDate=Mon Oct 31 00:00:00 EST 2005, effectiveStartDate=Thu Sep 01 00:00:00 EDT 2005}

      A workaround has been to add code in my BaseDataObject class to check
      for the old value equaling the new value in writeProperty(), and if
      so, do nothing.

      Attachments

        Activity

          People

            andrus Andrus Adamchik
            mkienenb Mike Kienenberger
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated: