Here is my desired transaction order:
- User1 select field, perform operation, update with new value.
- User2 select field, perform operation, update with new value.
- User3 select field, perform operation, update with new value.
From what I understand the first select only perform a write-lock while the second one perform read and write lock.
Both seems usable but in the first case, what value will User2 read? The initial value before User1 updates, or the value AFTER User1 updates (which is what I want)?
So I am confused, should I use SELECT ... FOR UPDATE or SELECT ... LOCK IN SHARE MODE?