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

For optimistic locking fix upsert, implement updateBatch

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • P2
    • Resolution: Done
    • 32.2.2
    • None
    • None
    • CP: sprint 113
    • 5
    • Core: Platform

    Description

      Upsert using INSERT ... ON CONFLICT (id) DO UPDATE fails because the INSERT trigger overwrites the _version property that the UPDATE trigger uses to detect optimistic locking conflicts.

      Solution:

      Implement upsert using a transaction and executing two SQL commands:

      UPDATE ...;
      IF NOT FOUND THEN INSERT ...;

      Adding updateBatch allows to replace upsertBatch depending on the use case: insertBatch or updateBatch. When optimistic locking is enabled the client must know in advance whether it is insert or update.

      TestRail: Results

        Attachments

          Issue Links

            Activity

              People

                julianladisch Julian Ladisch
                julianladisch Julian Ladisch
                Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved:

                  TestRail: Runs

                    TestRail: Cases