sl_1(X) - {T1 requests lock: (shared)}, {Waiting: None} ------ ul_2(x) - {T2 requests lock: (shared)}, {Waiting: T2 (upgrade)} ------ sl_3(X) - {T1 requests lock: (shared)}, {Waiting: T2 (upgrade), T3(shared)} ------ xl_2(X) - {T2 requests exclusive lock: T2 (exclusive lock)}, {Waiting: T3 (shared)} ------ u_1(X) - {T1 unlock: T2 (exclusive lock)}, {Waiting: T3 (shared)} ------ xl_4(X) - {T4 requests exclusive lock: T2 (exclusive lock)}, {Waiting: T3 (shared), T4 (exclusive)} ------ u_2(X) - {T2 unlock: T3 (shared)}, {Waiting: T4 (exclusive)} ------ sl_5(X) - {T5 requests shared lock: T3 (shared)}, {Waiting: T4 (exclusive), T5(shared)} ------ u_3(X) - {T3 unlock: T4 (exclusive)}, {Waiting: T5 (shared)} ------(Edited: 2020-04-15)
sl_1(X) - {x : {GroupMode: S, Waiting: no, List: [{T1, S, no}]}} ul_2(X) - {x : {GroupMode: U, Waiting: no, List: [{T1, S, no}, {T2, U, no}]}} sl_3(X) - {x : {GroupMode: U, Waiting: no, List: [{T1, S, no}, {T2, U, no}, {T3, S, yes}]}} xl_2(X) - {x : {GroupMode: U, Waiting: yes, List: [{T1, S, no}, {T2, U, no}, {T3, S, yes}, {T2, X, yes}]}} u_1(X) - {x : {GroupMode: X, Waiting: yes, List: [{T2, X, no}, {T3, S, yes}]}} xl_4(X) - {x : {GroupMode: X, Waiting: yes, List: [{T2, U, no}, {T3, S, yes}, {T4, X, yes}]}} u_2(X) - {x : {GroupMode: S, Waiting: yes, List: [{T3, S, no}, {T4, X, yes}]}} sl_5(X) - {x : {GroupMode: S, Waiting: yes, List: [{T3, S, no}, {T4, X, yes}, {T5, S, no}]}} u_3(X) - {x : {GroupMode: S, Waiting: yes, List: [{T4, X, yes}, {T5, S, no}]}}(Edited: 2020-04-20)
sl_1(X) transaction 1 gets shared lock on x: group mode is S, not waiting
ul_2(X) transaction 2 gets update lock on x: group mode is U, not waiting
sl_3(X) transaction 3 requests shared lock on x: group mode is U, waiting
xl_2(X) transaction 2 requests exclusive lock on x: group mode is U, waiting
u_1(X) transaction 1 requests unlock x: group mode is X, waiting DBMS upgrades update lock for transaction 2 on X to exclusive first before unlocking transaction 1
xl_4(X) transaction 4 requests exclusive lock on X: group mode is X, waiting the request is denied because you have to upgrade from an update lock to get an exclusive one
u_2(X) transaction 2 unlocks X: group mode is S, not waiting after transaction 2 unlocks, transaction 1 unlocks and transaction 3 which was waiting is now granted a shared lock on X
sl_5(X) transaction 5 gets a shared lock on X: group mode is S, not waiting
transaction 3 unlocks X: group mode is S, not waiting(Edited: 2020-04-20)
1. s1_1(x) Has lock: T1 (shared), Waiting for lock: none , Group Mode: S 2. u1_2(x) Has lock: T1 (shared), T2 (upgrade), Waiting for lock: none, Group mode: U 3. s1_3(x) Has lock: T1 (shared), T2 (upgrade), Waiting for lock: T3 (shared), Group mode: U 4. x1_2(x) Has lock: T1 (shared), T2 (upgrade), Waiting for lock: T2 (exclusive), T3 (shared), Group mode: U 5. u_1(x) Has lock: T2 (exclusive), Waiting for lock: T3 (shared), Group mode: X 6. x1_4(x) Has lock: T2 (exclusive), Waiting for lock: T3 (shared), T4 (exclusive), Group mode: X 7. u_2(x) Has lock: T3 (shared), Waiting for lock: T4 (exclusive), Group mode: S 8. s1_5(x) Has lock: T3 (shared), T5 (shared), Waiting for lock: T4 (exclusive), Group mode: S 9. u_3(x) Has lock: T5 (shared), Waiting for lock: T4 (exclusive), Group mode: S
sl_1(X) lock: T1 S, wait: none ul_2(X) lock: T1 S, wait: T2 U sl_3(X) lock: T1 S, wait: T2 U, T3 S xl_2(X) lock: T1 S, T2 X, wait: T3 S u_1(X) lock: T2 X, wait: T3 S, T4 X xl_4(X) lock: T2 X, wait: T4 X, T5 S u_2(X) lock: T3 S, wait: T4 X sl_5(X) lock: T3 S, wait: T4 X, T5 S u_3(X) lock: T4 X, wait: T5 S(Edited: 2020-04-20)
sl_1(X) S, Has lock: T1 (shared), Waiting:
ul_2(x) U, Has lock: T1 (shared), T2 (upgrade), Waiting:
sl_3(X) U, Has lock: T1 (shared), T2 (upgrade), Waiting: T3(shared)
xl_2(X) U, Has lock: T1 (shared), T2 (upgrade), Waiting: T3 (shared), T2 (exclusive)
u_1(X) X,Has lock: T2 (exclusive lock), Waiting: T3 (shared)
xl_4(X) X, Has lock: T2 (exclusive lock), Waiting: T3 (shared), T4 (exclusive)
u_2(X) S, Has lock: T3 (shared), Waiting: T4 (exclusive)
sl_5(X) S,Has lock: T3 (shared), T5(shared), Waiting: T4 (exclusive)
u_3(X) S, Has lock: T5 (shared)), Waiting: T4 (exclusive(Edited: 2020-04-20)