Transaction Isolation Levels
Transaction Isolation Levels
BSSE - II (Semester I)
Subject : RDBMS
In the screenshot below I start with running two terminal, Terminal 1 on the
left, and Terminal 2 on the right. On both these terminals I fetch the records from
the student table. Then I begin a transaction with repeatable read as the isolation
level on Terminal 1, and update one of the rows. Doing so reflects the change in
Terminal 1, where the update was made from. Then I begin a transaction on
Terminal 2 with the same isolation level as Terminal 1, but fetching the records does
not show the updated rows.
Here, there is a new transaction started in both the Terminals, where the
query result shows the updated records/rows.
And then inserts the result (30) as the value in a new row with class = 2.
Concurrently, serializable transaction B computes:
and obtains the result 300, which it inserts in a new row with class = 1. Then both
transactions try to commit. If either transaction were running at the Repeatable
Read isolation level, both would be allowed to commit; but since there is no serial
order of execution consistent with the result, using Serializable transactions will
allow one transaction to commit and will roll the other back with this message: