Manually ID'd Versioned Entities are not Optimistically Locked

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Won't Fix
    • Priority: Major - P3
    • None
    • Affects Version/s: 3.4.2
    • Component/s: Write Operations
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      For Entities that have non DB-Generated IDs, "Saves" to the DB are not optimistically locked. For example, it is possible to have two Versioned Entities with the same primary key and null versions and one will overwrite the other. This is undesirable when primary keys are meaningful and meaningful data is associated with the Entity.

      This behavior is exposed by the following test:

      {{
      @Test(expected = ConcurrentModificationException.class)
      public void testManuallyVersionedConcurrentModification()

      { final String id = UUID.randomUUID().toString(); final ManuallyVersionedEntity entity1 = new ManuallyVersionedEntity(); final ManuallyVersionedEntity entity2 = new ManuallyVersionedEntity(); entity1.setId(id); entity2.setId(id); getDs().save(entity1); getDs().save(entity2); }

      }}

            Assignee:
            Unassigned
            Reporter:
            Sage M Pierce
            None
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: