Uploaded image for project: 'RAML Module Builder'
  1. RAML Module Builder
  2. RMB-872

Optimistic locking support for TenantLoading PUT

    XMLWordPrintable

    Details

    • Template:
      Standard Bug Write-Up Format
    • Sprint:
      CP: sprint 124, CP: sprint 125
    • Story Points:
      2
    • Development Team:
      Core: Platform

      Description

      TenantLoading fails if a PUT request is rejected because the reference or sample record doesn't contain the _version property needed for optimistic locking.

      Three possible implementations:

      A)

      If a PUT gets a 409 response (optimistic locking failure) TenantLoading should GET the record, take the _version property, put it into the reference or sample record, and retry the PUT.

      B)

      Add a new strategy to TenantLoading that module authors can select: PUT with version. It first GETs the record, takes the _version property, and runs the PUT with the correct _version. Disadvantage: Module authors will likely forget to change the strategy when enabling optimistic locking.

      C)

      The current code is PUT, if it fails, POST.
      Replace it by GET, if 404 run a POST, otherwise insert the _version from the GET into the record and make a PUT (possible optimization: suppress PUT if record is the same).

       

      We decided to implement C). Having multiple requests is not a big problem because we have only a few reference and sample records. A solution that disables optimistic locking can be implemented at a later point.

      Inventory

      Optimistic locking of instances, holdings and items is only affected if upgrading with sampleData enabled. Therefore production installations are not affected yet.

        TestRail: Results

          Attachments

            Activity

              People

              Assignee:
              julianladisch Julian Ladisch
              Reporter:
              julianladisch Julian Ladisch
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  TestRail: Runs

                    TestRail: Cases