Uploaded image for project: 'Spring Data Couchbase'
  1. Spring Data Couchbase
  2. DATACOUCH-212

Optimistic Locking is not working when using Repository save method

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Complete
    • Affects Version/s: 2.0 GA, 2.1 RC1 (Hopper)
    • Fix Version/s: 2.1 RC1 (Hopper)
    • Component/s: None
    • Labels:
      None

      Description

      Optimistic Locking doesn't appear to be working any longer when using the repository "save" method to save an entity. This was previously working in the 1.4 release.

      Steps to reproduce:
      -Create a Document class with the @Version annotation
      -Create a CrudRepository referencing the Document class
      -Load an existing document via the repository "findOne" method in thread 1 (validated the cas is set in this document)
      -In thread 2 update the same document
      -In thread 1, save the document using the repository "save" method

      Expected Result:
      A CASMismatchException is thrown

      Actual Result:
      No exception is thrown and thread 1 overwrites the document thread 2 had saved

      Note: this exact scenario was working in 1.4 release

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              simonbasle Simon Baslé
              Reporter:
              jscherle Jordan Scherle
              Last updater:
              Spring Issues Spring Issues
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: