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

DataContext.currentSnapshot() doesn't set snapshot entity name

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 4.0.M3, 3.1.1
    • Fix Version/s: 4.0.M4, 3.1.2
    • Component/s: None
    • Labels:
      None

      Description

      DataContext.currentSnapshot() fails to set created snapshot entity name. This causes confusion downstream. One obscure case that I was finally able to trace to this issue was related to inheritance:

      • "currentSnapshot" was called for concrete subclass during new object commit.
      • returned snapshot ended up in the shared cache
      • later a RelationshipQuery for another object pointing to this one received the snapshot from cache.
      • The result was the attempt to instantiate an abstract superclass instead of subclass

      So we need to fix 'currentSnapshot' and maybe also add sanity checks to "objectsFromDataRows" to throw on invalid snapshots.

        Attachments

          Activity

            People

            • Assignee:
              andrus Andrus Adamchik
              Reporter:
              andrus Andrus Adamchik
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: