Professional Documents
Culture Documents
Transactions and Concurrency Control
Transactions and Concurrency Control
S1: R1(A); R1(C); R2(B); W2(B); R3(B); R1(A); R3(C); W3(C); W1(A)
S2: R2(A); R1(C); R2(B); R3(B); W2(B); R1(A); R3(C); W3(C); W1(A)
How many minimum number of moves (where a move consisting of changing the position of
one of the operations) are required to convert S into a conflict serializable schedule?
(a) 1 (b) 2
(b) 3 (d) 4
3. Consider 2 schedules S1 and S2 with same set of transactions and precedence graph of S1 is
same as precedence graph of S2. Which of the following statement is True?
(a) Both S1 and S2 are conflict equal and conflict serializable schedule
(b) Both S1 and S2 are conflict equal but may not conflict serializable schedule
(c) Both S1 and S2 are conflict equal but may not equal schedules
(d) Both S1 and S2 are conflict equal and but may not view equivalent
S1: r1(x), r2(z), r1(z), r3(x), r3(y), w1(x), C1, w3(y), C3, r2(y), w2(y), w2(z), C2
S2: r1(x), r2(z), r1(z), r3(x), r3(y), w1(x), w3(y), r2(y), w2(z), w2(y), C1, C2, C3
S3: r1(x), r2(z), r3(x), r1(z), r2(y), r3(y), w1(x), C1, w2(z), w3(y), w2(y), C3, C2
1
5. For the given schedule which of the following statement is true?
S: R4(A), R2(A), R3(A), W1(B), W2(C), R4(B), W2(B)
How many operations (Read/ Write) can be placed in ‘X’ to make ‘S’, not conflict
serializable?
How many conflict equal serial schedules are possible with the above schedule?
Based on a simple relation TA(SID, CID, Stipend) stores TA assignments and stipends. TA’s
are identified by their student ID’s (SID’s). Consider the following, if transaction executed by
2 different clients at approximately the same time.
T1 T2
Before either transaction starts, there is a tuple (987, ‘CS145’, 1900) in TA.
2
8. Suppose T1 executes with isolation level READ COMMITTED and T2 executes with isolation
level READ UNCOMMITTED. Which one of the following figures cannot be a possible final
stipend value for TA987?
9. Now, suppose instead that T1 executes with isolation level. Repeatable Read and T2 executes
with isolation level Read Committed. Which one of the following figures cannot be a possible
value for TA987?
11. Which of the following is TRUE with regards to the correct answer for the above question?
12. Which among the following 2-phase locking protocols is a deadlock free?
3
Given below are some transaction schedules that involve three transactions:
T1-T2-T3
Schedule 1:
T2: Rx, T2: Ry, T1: Wx, T3: Wy, T3: Wz, T1: Rz, T2: Wy
Schedule 2:
T2: Rx, T2: Wy, T3: Ry, T3: Wx, T1: Wy, T3: Rx, T1: Ry, T2: Wy
Schedule 3:
T1: Rx, T2: Ry, T3: Wy, T2: Rz, T3: Rz, T1: Wz, T1: Wy, T2: Wy
Schedule 4:
T1: Rx, T3: Wy, T2: Rz, T3: Rz, T1: Wy, T2: Wx, T1: Ry, T2: Wz
14. For the conflict serializable schedule found in the previous question, the equivalent serial
schedule possible:
15. Which of the following is True about the given schedule ‘S’?
T1 T2
R(A)
A=A+100
R(A)
A=A*2
W(A)
W(A)
R(B)
B= B/2
W(B)
R(B)
B= B-100
W(B)
4
(a) It is conflict serializable
(b) It is view serializable but not conflict serializable
(c) It is conflict serializable but not view serializable
(d) It is not serializable
T1 T2
Read(A)
Write(A)
Read(A)
Commit
Read(A)
Abort
5
18. There are 2 transactions, T1 with 2 instructions and T2 with 5 instructions. Find the number of
serial and concurrent schedules respectively.
19. Which of the following statements are true about recoverable and cascadeless schedules?
(a) All the schedules which are allowed under basic time stamp ordering protocols are also
allowed under Thomas Write Rule
(b) Schedule which are allowed under Thomas write rule are also allowed under
multiversion time stamp ordering protocol
(c) All the schedules which are not allowed under Thomas write rule are also not allowed
under multiversion time stamp ordering protocol
(d) None of these