Uploaded image for project: 'Atlas'
  1. Atlas
  2. ATLAS-289

updateEntity does not remove existing edge for multiplicity-one reference

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 0.6-incubating
    • 0.6-incubating
    • None

    Description

      updateEntity does not properly update a multiplicity-one non-composite reference, such that the entity appears to not have been updated when it is retrieved after updateEntity is called.

      updateEntity is adding an edge from the source vertex to the
      new target vertex, but not removing the existing edge that connects the
      source to the old target. So after the update completes, the source vertex has 2 edges for this class reference (which violates the upper bound constraint defined for that attribute but that constraint is not enforced).

      When the source entity is retrieved after the update, GraphBackedMetadataRepository.GraphToTypedInstanceMapper.mapVertexToClassReference() uses whatever edge is returned first by the iterator to set the reference value. If the first edge is the "old" edge, the returned entity appears to have not been updated as it is referencing the original target entity.

      Attachments

        1. UpdateEntityTest.java
          5 kB
          Dave Kantor
        2. ATLAS-289-v0.patch
          12 kB
          Dave Kantor

        Activity

          People

            dkantor Dave Kantor
            dkantor Dave Kantor
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: