[ Prev ]
2020-04-15

-- Apr 15 In-Class Exercise Thread
Resource Description for Screen Shot 2020-04-15 at 5.27.24 PM.png
((resource:Screen Shot 2020-04-15 at 5.27.24 PM.png|Resource Description for Screen Shot 2020-04-15 at 5.27.24 PM.png))

-- Apr 15 In-Class Exercise Thread
Resource Description for 157B.InClass4-15.PNG
((resource:157B.InClass4-15.PNG|Resource Description for 157B.InClass4-15.PNG))

-- Apr 15 In-Class Exercise Thread
  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) - {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)} ------
2020-04-19

-- Apr 15 In-Class Exercise Thread
s1_1(x) LOCK TABLE: { X { GroupMode : S, Waiting: No , List : {1, S, NO}}}
ul_2(x) LOCK TABLE: {X: {GroupMode : U, Waiting: No, List: {1, S, NO}, {2, U, NO}}}
sl_3(x) LOCK TABLE: {X: {GroupMode : U, Waiting: Yes, List: {1, S, NO}, {2, U, NO}, {3, S, YES}}
xl_2(x) LOCK TABLE: {X: {GroupMode : U, Waiting: Yes, List: {1, S, NO}, {2, U, NO}, {3, S, YES} {2, X, YES}}
u_1(x) LOCK TABLE: {X: {GroupMode : U, Waiting: Yes, List: {1, S, NO}, {2, U, NO}, {3, S, NO} {2, X, YES}}
xl_4(x) LOCK TABLE: {X: {GroupMode : U, Waiting: Yes, List: {1, S, NO}, {2, U, NO}, {3, S, NO} {2, X, YES}, {4, X, YES}}
U_1(x) LOCK TABLE: {X: {GroupMode : U, Waiting: Yes, List: {1, S, NO}, {2, U, NO}, {3, S, NO} {2, X, NO}, {4, X, YES}}
Sl_5(x) LOCK TABLE: {X: {GroupMode : U, Waiting: Yes, List: {1, S, NO}, {2, U, NO}, {3, S, NO} {2, X, NO}, {4, X, YES}, {5, X, NO}}
u_3(x) LOCK TABLE: {X: {GroupMode : U, Waiting: Yes, List: {1, S, NO}, {2, U, NO}, {3, S, NO} {2, X, NO}, {4, X, NO}, {5, X, NO}}
s1_1(x) LOCK TABLE: { X { GroupMode : S, Waiting: No , List : {1, S, NO}}} ul_2(x) LOCK TABLE: {X: {GroupMode : U, Waiting: No, List: {1, S, NO}, {2, U, NO}}} sl_3(x) LOCK TABLE: {X: {GroupMode : U, Waiting: Yes, List: {1, S, NO}, {2, U, NO}, {3, S, YES}} xl_2(x) LOCK TABLE: {X: {GroupMode : U, Waiting: Yes, List: {1, S, NO}, {2, U, NO}, {3, S, YES} {2, X, YES}} u_1(x) LOCK TABLE: {X: {GroupMode : U, Waiting: Yes, List: {1, S, NO}, {2, U, NO}, {3, S, NO} {2, X, YES}} xl_4(x) LOCK TABLE: {X: {GroupMode : U, Waiting: Yes, List: {1, S, NO}, {2, U, NO}, {3, S, NO} {2, X, YES}, {4, X, YES}} U_1(x) LOCK TABLE: {X: {GroupMode : U, Waiting: Yes, List: {1, S, NO}, {2, U, NO}, {3, S, NO} {2, X, NO}, {4, X, YES}} Sl_5(x) LOCK TABLE: {X: {GroupMode : U, Waiting: Yes, List: {1, S, NO}, {2, U, NO}, {3, S, NO} {2, X, NO}, {4, X, YES}, {5, X, NO}} u_3(x) LOCK TABLE: {X: {GroupMode : U, Waiting: Yes, List: {1, S, NO}, {2, U, NO}, {3, S, NO} {2, X, NO}, {4, X, NO}, {5, X, NO}}

-- Apr 15 In-Class Exercise Thread
 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) - {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}]}}

-- Apr 15 In-Class Exercise Thread
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)
<pre> sl_1(X) transaction 1 gets shared lock on x: group mode is S, not waiting </pre> <pre> ul_2(X) transaction 2 gets update lock on x: group mode is U, not waiting </pre> <pre> sl_3(X) transaction 3 requests shared lock on x: group mode is U, waiting </pre> <pre> xl_2(X) transaction 2 requests exclusive lock on x: group mode is U, waiting </pre> <pre> 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 </pre> <pre> 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 </pre> <pre> 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 </pre> <pre> sl_5(X) transaction 5 gets a shared lock on X: group mode is S, not waiting </pre> <pre> transaction 3 unlocks X: group mode is S, not waiting </pre>

-- Apr 15 In-Class Exercise Thread
 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
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

-- Apr 15 In-Class Exercise Thread
Resource Description for Screen Shot 2020-04-20 at 3.14.25 PM.png
((resource:Screen Shot 2020-04-20 at 3.14.25 PM.png|Resource Description for Screen Shot 2020-04-20 at 3.14.25 PM.png))

-- Apr 15 In-Class Exercise Thread
 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) 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

-- Apr 15 In-Class Exercise Thread
 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)
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
X