abhishek f57127444f Lock productlocations rows before checking stock in CreateOrder
The order-placement stock check (read available qty, then insert an "out"
deduction) had no row lock, so two concurrent orders for the same product
could both pass the availability check before either committed its
deduction, overselling the item. Locks each ordered product's
productlocations row with SELECT ... FOR UPDATE up front, in a fixed
(productid, locationid) order across all items so overlapping concurrent
orders contend for locks in the same sequence instead of deadlocking.
2026-07-27 18:48:10 +05:30
2026-05-25 11:52:26 +05:30
2026-07-27 11:42:32 +05:30
2026-05-25 11:52:26 +05:30
2026-05-25 11:52:26 +05:30
2026-07-04 17:49:54 +05:30
2026-07-21 16:17:51 +05:30
2026-07-09 18:03:44 +05:30
Description
No description provided
17 MiB
Languages
Go 99.2%
JavaScript 0.7%