8(A) ISOLATION LEVELS Consider a table Item(name,cost) where name is a key. Supp
ID: 3700086 • Letter: 8
Question
8(A) ISOLATION LEVELS Consider a table Item(name,cost) where name is a key. Suppose initially there are two tuples in Item: (A,20) and (B,30). Consider the following two concurrent transactions, each of which runs once and commits. You may assume there are no other transactions in the system and that individual statements execute atomically. T1: begin transaction S1: insert into Item values (’C’,40) S2: update Item set price = price+30 where name=’A’ commit T2: begin transaction S3: select avg(price) as p1 from Item S4: select avg(price) as p2 from Item commit Suppose that transaction T1 executes with isolation level _serializable_. (a) If transaction T2 also executes with isolation level _serializable_, what are all the possible pairs of values p1 and p2 returned by T2? (b) If transaction T2 executes with isolation level _repeatable read_, what are all the possible pairs of values p1 and p2 returned by T2? (c) If transaction T2 executes with isolation level _read committed_, what are all the possible pairs of values p1 and p2 returned by T2? (d) If transaction T2 executes with isolation level _read uncommitted_, what are all the possible pairs of values p1 and p2 returned by T2?
Explanation / Answer
(a) (25,25) (40,40)
(b) (25,25) (40,40)
(c) (25,25) (25,40) (40,40)
(d) (25,25) (25,30) (25,40) (30,30) (30,40) (40,40)
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.