Question
Consider the following interleaving of four transactions with the initial values: bal x = 100 bal y = 200 bal z = 300 T 1
Consider the following interleaving of four transactions with the initial values: balx = 100 baly = 200 balz = 300
T1 | T2 | T3 | T4 |
begin_transaction | begin_transaction | begin_transaction | begin_transaction |
read(balx) | read(baly) | read(balz) | sum = 0 |
balx = balx + 100 | baly = baly - 10 | balz = balz + 50 | read(balz) |
write(balx) | write(baly) | write(balz) | sum = sum + balz |
read(baly) | read(balz) | commit | read(baly) |
baly = baly - 100 | balz = balz + 10 | sum = sum + baly | |
write(baly) | write(balz) | read(balx) | |
commit | commit | sum = sum + balx | |
commit |
a)If the transactions were permitted to run as shown, what would be the final values of balx, baly, balz, and sum?
b)Assuming appropriate use of rigorous 2-Phase Locking, and assuming priority on gaining locks is from left to right, and it takes one time step to gain / release locks, show the interleaving of the transactions over time.
c)What are the final values of balx, baly, balz, and sum?
d)Repeat parts (b) and (c) if transaction T2 performs a rollback instead of a commit.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started