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
- blocks
-
MODINVSTOR-713 Enable support for optimistic locking (failOnConflict) in instances/holdings/items (part1)
-
- Closed
-
- relates to
-
RMB-374 Add PostgresClient.updateBatch methods
-
- Closed
-