Details
-
Story
-
Status: Closed (View Workflow)
-
P3
-
Resolution: Done
-
None
-
None
-
None
-
ACQ Sprint 140, ACQ Sprint 141
-
3
-
Thunderjet
-
Morning Glory (R2 2022)
-
TBD
Description
Purpose/Overview:
Enable optimistic locking for most tables. Seeing a 409 error would be an improvement over modifications that fail quietly and affect data integrity. It will also help us to see how frequent these issues are in production.
Requirements/Scope:
Enable optimistic locking with failure for the following tables:
budget
transaction
budget_expense_class
fund
group_fund_fiscal_year
expense_class
fiscal_year
fund_type
groups
ledger
ledger_fiscal_year_rollover
Approach:
- Add the _version attribute to the matching schemas in acq-models. It might be needed to look beyond the obvious, for instance shared_budget should also have the attribute. Merge that PR first.
"_version": { "type": "integer", "description": "Record version for optimistic locking" },
- Change the table definitions in schema.json to add "withOptimisticLocking": "failOnConflict".
- Return a 409 HTTP code when a conflict occurs, which can be detected by the SQL error code 23F09. For that, modify ResponseUtils$handleFailure and check ((PgException)cause).getCode().
- Update API and module versions with a major change.
Acceptance criteria:
- All unit tests and integration tests (finance, orders, cross-modules) pass.
- The MODFISTO-260 test parallel-update-order-lines-different-orders reports a 409 instead of quietly updating the budgets wrongly.
TestRail: Results
Attachments
Issue Links
- defines
-
UXPROD-3163 Part 2 - Finance - Implementing Optimistic Locking
-
- Open
-
-
UXPROD-3663 Part 1 - Finance - Implementing Optimistic Locking
-
- Closed
-
-
UXPROD-3666 Improve support for parallel processing
-
- In Refinement
-
- has to be done after
-
MODORDERS-694 PendingToOpenEncumbranceStrategy is not thread-safe
-
- Closed
-
- has to be done before
-
MODFISTO-304 Lock budgets to update totals
-
- Closed
-
-
STSMACOM-668 ControlledVocab - optimistic locking
-
- Closed
-
-
UIF-379 Finance optimistic locking
-
- Closed
-
-
UISACQCOMP-104 Create common component OptimisticLockingBanner
-
- Closed
-
- relates to
-
MODEUR-134 Update finance API versions
-
- Closed
-
-
MODFISTO-297 Spike: Proof of concept to support parallel requests
-
- Closed
-