I have below sequence of transaction with isolation level as serializable
trnsaction1 transaction2
get row2 // value1
update row1
update row2//update to 2
commit
get row1
get row2 // lin6
will transaction 2 see the updated value of row 1 and row 2. Sure that transaction2 will not see the updated value of row2(update by transaction 1) at line6 but not sure will it see the updated value of row1 updated by transaction1?
Once transaction1 commits its work, transaction 2 will see the updated changes in both of the last two lines. That is, unless you do
SET TRANSACTION READ ONLYas the very first action in your transaction.In a read-write transaction, individual statements are read-consistent, but not between multiple statements.
Edit:
steve, I believe that’s incorrect. From the documentation:
[Read commited transaction]
[Serializable]