Subject: | Ordered race conditions |
We have had various problems with race conditions and the Ordered component. There's a race
between the SELECT and UPDATE, and also during multiple updates (as was done in old approach
of updating each row in a separate query).
For inserts what I have done is SELECT 1 FROM grouping_table WHERE id = group_id FOR
UPDATE. Note the lock is on the row in the grouping table, not the table that is using Ordered.
Only tested in Postgresql.
I suppose SELECT .. FOR UPDATE on the Ordered rows would work for other operations, right?
See also RT#79773