|
|
|
|
|
by Diggsey
1452 days ago
|
|
One thing that can be surprising is that for "REPEATABLE READ", not all "reads" are actually repeatable. There are at least two ways (that I'm aware of) that this can be violated. For example, if you run an update statement like this: UPDATE foo SET bar = bar + 1
Then the read of "bar" will always use the latest value, which may be different from the value other statements in the same transaction saw. |
|
Repeatable read isolation creates read locks so that other transactions cannot write to those records. Of course our own transaction has to first wait for outstanding writes to those records to commit before starting.
Best as I know the goal is not to prevent one's own transaction from updating the records we read; the read locks will just get upgraded to write locks.