Transactions and Concurrency · Database Management System · GATE CSE
Marks 1
Once the DBMS informs the user that a transaction has been successfully completed, its effect should persist even if the system crashes before all its changes are reflected on disk. This property is called
Which of the following statements about the Two Phase Locking (2PL) protocol is/are TRUE?
Suppose a database system crashes again while recovering from a previous crash. Assume checkpointing is not done by the database either during the transactions or during recovery.
Which of the following statements is/are correct?
I. Strict two-phase locking protocol generates conflict serializable schedules that are also recoverable.
II. Timestamp-ordering concurrency control protocol with Thomas Write Rule can generate view serializable schedules that are not conflict serializable.
Which of the above statements is/are TRUE?
read (x) ; x: = x - 50; write (x); read (y); y: = y + 50; write (y)
The constraint that the sum of the accounts x and y should remain constant is that of
I. 2-phase locking
II. Time-stamp ordering
Marks 2
Consider the following read-write schedule $S$ over three transactions $T_{1}$, $T_{2}$, and $T_{3}$, where the subscripts in the schedule indicate transaction IDs:
$S: r_{1}(z); w_{1}(z); r_{2}(x); r_{3}(y); w_{3}(y); r_{2}(y); w_{2}(x); w_{2}(y);$
Which of the following transaction schedules is/are conflict equivalent to $S$?
Let Ri(z) and Wi(z) denote read and write operations on a data element z by a transaction Ti, respectively. Consider the schedule S with four transactions.
S : R4(x), R2(x), R3(x), R1(y), W1(y), W2(x), W3(y), R4(y)
Which one of the following serial schedules is conflict equivalent to S?
Let S be the following schedule of operations of three transactions T1, T2 and T3 in a relational database system:
R2(Y), R1(X), R3(Z), R1(Y), W1(X), R2(Z), W2(Y), R3(X), W3(Z)
Consider the statements P and Q below:
P: S is conflict-serializable.
Q: If T3 commits before T1 finishes, then S is recoverable.
Which one of the following choices is correct?
Let ri(z) and wi(z) denote read and write operations respectively on a data item z by a transaction Ti. Consider the following two schedules.
S1 : r1(x) r1(y) r2(x) r2(y) w2(y) w1(x)
S2 : r1(x) r2(x) r2(y) w2(y) r1(y) w1(x)
Which one of the following options is correct?

Here, RX stands for “Read(X)” and WX stands for “Write(X)”. Which one of the following schedules is conflict equivalent to the above schedule?
S = r2(X); r1(X); r2(Y); w1(X); r1(Y); w2(X); a1; a2
where ri(Z) denotes a read operation by transaction Ti on a variable Z, wi(Z) denotes a write operation by Ti on a variable Z and ai denotes an abort by transaction Ti .
Which one of the following statements about the above schedule is TRUE?
Step 1. T acquires exclusive locks to $${{O_1},...,{O_k}}$$ in increasing order of their
addresses.
Step 2. The required operations are performed.
Step 3. All locks are released.
This protocol will

Suppose that the transaction $$T1$$ fails immediately after time instance $$9.$$ Which one of the following statements is correct?
(start, $$T4$$); (write, $$T4, y, 2, 3$$); (start, $$T1$$); (commit, $$T4$$); (write, $$T1, z, 5, 7$$);
(checkpoint);
(start, $$T2$$); (write, $$T2, x, 1, 9$$); (commit, $$T2$$); (start, $$T3$$), (write, $$T3, z, 7, 2$$);
If a crash happens now and the system tries to recovver using both undo and redo operations, what are the contents of the undo list and the redo list?

T1 : r1 (X) ; r1 (Z) ; w1 (X) ; w1 (Z)
T2 : r2 (X) ; r2 (Z) ; w2 (Z)
T3 : r3 (X) ; r3 (X) ; w3 (Y)
S1: r1(X); r3(Y); r3(X); r2(Y); r2(Z); w3(Y); w2(Z); r1(Z); w1(X); w1(Z)
S2: r1(X); r3(Y); r2(Y); r3(X); r1(Z); r2(Z); w3(Y); w1(X); w2(Z); w1(Z)
Which one of the following statements about the schedules is TRUE?T1 : read (P) ;
read (Q) ;
if P = 0 then Q : = Q + 1 ;
write (Q).
T2 : read (Q) ;
read (P)
if Q = 0 then P : = P + 1 ;
write (P).
Any non-serial interleaving of T1 and T2 for concurrent execution leads toT1: R1[ x ] W1[ x ] W1[ y ]
T2: R2[ x ] R2[ y ] W2[ y ]
S1: R1[ x ] R2[ x ] R2[ y ] W1[ x ] W1[ y ] W2[ y ]
S2: R1[ x ] R2[ x ] R2[ y ] W1[ x ] W2[ y ] W1[ y ]
S3: R1[ x ] W1[ x ] R2[ x ] W1[ y ] R2[ y ] W2[ y ]
S4: R2[ x ] R2[ y ] R1[ x ] W1[ x ] W1[ y ] W2[ y ]
I. $$\pi_{R-S}(r) - \pi_{R-S} \left (\pi_{R-S} (r) \times s - \pi_{R-S,S}(r)\right )$$
II. $$\left\{t \mid t \in \pi_{R-S} (r) \wedge \forall u \in s \left(\exists v \in r \left(u = v[S] \wedge t = v\left[R-S\right]\right )\right )\right\}$$
III.$$\left\{t \mid t \in \pi_{R-S} (r) \wedge \forall v \in r \left(\exists u \in s \left(u = v[S] \wedge t = v\left[R-S\right]\right )\right ) \right\}$$
IV. Select R.a, R.b
From R, S
Where R.c = S.c
Which of the above queries are equivalent?[ Notation: In the following NYO represents the action Y (R for read, W for write) performed by transaction N on object O. ]
(S1) 2RA 2WA 3RC 2WB 3WA 3WC 1RA 1RB 1WA 1WB
(S2) 3RC 2RA 2WA 2WB 3WA 1RA 1RB 1WA 1WB 3WC
(S3) 2RZ 3RC 3WA 2WA 2WB 3WC 1RA 1RB 1WA 1WB
Which of the following statements is TRUE?S1: r1(X); r1(Y); r2(Y); r2(X); w2(Y); w1(X);
S2: r1(X); r2(X); r2(Y); w2(Y); r1(Y); w1(X);
T1: read (A); T2: read (B);
read (B); read (A);
if A = 0 then B ← B + 1; if B ≠ 0 then A ← A - 1;
write (B); write (A);
Which of the following schemes, using shared and exclusive locks, satisfy the requirements for strict two phase locking for the above transactions?Which of the following statements is correct?