55 kodosszeg FIZETÉS felvitel JUTALOM felvitel 11-es dolgozó kap 200-at 11-es dolgozó kap 50-et SELECT osszeg INTO x FROM d WHERE kod=11 SELECT osszeg INTO y FROM d WHERE kod=11 UPDATE d SET osszeg = x WHERE kod=11 UPDATE d SET osszeg = y + 50 WHERE kod= D
SELECT osszeg INTO g FROM d WHERE kod=11 SELECT osszeg INTO h FROM d WHERE kod=11 UPDATE d SET osszeg = g WHERE kod=11 UPDATE d SET osszeg = h + 50 WHERE kod=11 T1T2 H r(x) w(x) c r(x) w(x) c r 1 (x)w 1 (x)c1c1 r 2 (x)w 2 (x)c2c2 nem ST
r 1 (x)w 1 (x)c1c1 r 2 (x)w 2 (x)c2c2 LOCK : 2PL-R/W-WF l 1r (x) 5 deadlock r 1 (x) 5 l 2r (x) 5 r 2 (x) 5 l 1w (x) 5 l 2w (x) 5 r 1 (x) r 2 (x)
r 1 (x)w 1 (x)c1c1 r 2 (x)w 2 (x)c2c2 LOCK : 2PL-R/W/U-WF l 1u (x) 5 r 1 (x) 5 l 2u (x) 5 l 1w (x) 5 w 2 (x) 205 u 1w (x) 205 c1c1 r 2 (x) 205 l 2w (x) 205 w 2 (x) 255 u 2w (x) 255 c2c2 r 1 (x)w 1 (x)c1c1 r 2 (x)w 2 (x)c2c2
r 1 (x)w 1 (x)c1c1 r 2 (x)w 2 (x)c2c2 LOCK : -R/W-WF l 1r (x) 5 r 1 (x) 5 l 2r (x) 5 r 2 (x) 5 u 1r (x) 5 l 2w (x) 5 l 1w (x) 5 w 2 (x) 55 u 2w (x) 55 w 1 (x) 205 u 1w (x) 205 c1c1 c2c2 r 1 (x)w 1 (x)c1c1 r 2 (x)w 2 (x)c2c2
r 1 (x)w 1 (x)c1c1 r 2 (x)w 2 (x)c2c2 LOCK : 2PL-/W-WF r 1 (x) 5 r 2 (x) 5 l 1w (x) 5 w 1 (x) 205 l 2w (x) 205 u 1w (x) 205 c1c1 w 2 (x) 55 u 2w (x) 55 c2c2 r 1 (x)w 1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