When using Repeatable Read isolation, you are guaranteed that the rows you read using SELECT wont be modified until your transaction completes.
This seems to be similar to what SELECT .. FOR UPDATE offers.
So what is the point of using SELECT FOR UPDATE when using Repeatable Read isolation?
When you read a record under Repeatable Read, you get a read-lock, but other transactions can also get a read lock, which might prevent you from making an update later. Using FOR UPDATE informs any other transactions which request a read lock that they should wait until you're finished updating the record.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With