Question: Using Write and Read locks (X and S locks, respectively), describe a locking strategy which will mitigate the inconsistent analysis issue shown in the diagram.
Using Write and Read locks (X and S locks, respectively), describe a locking strategy which will mitigate the inconsistent analysis issue shown in the diagram. Ensure that you detail a strategy on how you will solve any deadlocks that occur. Transaction A sums up account balances. Transaction B transfers 10 units from Account 3 to 1. The inconsistent happens because Transaction B changed Account 3s amount while Transaction A was summing up the account balances, Transaction A obtained an incorrect result.

Account 1 Account 2 Account 3 60 50 20 Transaction A Time Transaction B t1 Retrieve Acc 1, sum = 60 Retrieve Acc 2 Sum = 110 t2 t3 Retrieve Acc 3 t4 Update Acc 3, 20-> 10 t5 Retrieve Acc 1 t6 Update Acc 1,60 -> 70 t7 COMMIT Retrieve Acc 3, sum = 120, not 130 t8 Account 1 Account 2 Account 3 60 50 20 Transaction A Time Transaction B t1 Retrieve Acc 1, sum = 60 Retrieve Acc 2 Sum = 110 t2 t3 Retrieve Acc 3 t4 Update Acc 3, 20-> 10 t5 Retrieve Acc 1 t6 Update Acc 1,60 -> 70 t7 COMMIT Retrieve Acc 3, sum = 120, not 130 t8
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
