3 ms·
Probably because it’s more work, and it’s logic that you have to write and get correct. Whereas “for update” pretty much just works. But there are definitely m
by amw-zero 3y ago
Probably because it’s more work, and it’s logic that you have to write and get correct. Whereas “for update” pretty much just works.
But there are definitely many valid solutions, including just setting the specific transaction to serializable and handling transaction retries.
- GauntletWizard 3y agoand handling retries is something I almost never see, and more infrequently see done right.
- gav 3y agoOptimistic locking is a great solution to avoid holding a lock for an indeterminate period of time as you wait for a user or external system to provide updates.