Question

Consider the following database schedule with two transactions, T1T_1 and T2T_2.

S=r2(X);r1(X);r2(Y);w1(X);r1(Y);w2(X);a1;a2S = r_2(X); r_1(X); r_2(Y); w_1(X); r_1(Y); w_2(X); a_1; a_2

where ri(Z)r_i(Z) denotes a read operation by transaction TiT_i on a variable ZZ, wi(Z)w_i(Z) denotes a write operation by TiT_i on a variable ZZ and aia_i denotes an abort by transaction TiT_i.

Which one of the following statements about the above schedule is TRUE?

Choose one option
Official answer and solution
Official answer
C
From
Official GATE 2016 answer key

Solution

Inspect the schedule for uncommitted reads and write-write dependencies to evaluate recoverability and cascading aborts.

Analyze the sequence of operations in schedule SS:

  1. r2(X)r_2(X)
  2. r1(X)r_1(X)
  3. r2(Y)r_2(Y)
  4. w1(X)w_1(X)
  5. r1(Y)r_1(Y)
  6. w2(X)w_2(X)
  7. a1a_1
  8. a2a_2

Check for Dirty Reads (Reading Uncommitted Writes):

  • T1T_1 writes XX at step 4 (w1(X)w_1(X)). Does T2T_2 read XX after step 4? Step 6 is w2(X)w_2(X), which is a write, not a read.
  • T2T_2 writes XX at step 6 (w2(X)w_2(X)). No read follows step 6.
  • Neither transaction reads any data value written by the other transaction. Thus, there are NO dirty reads in SS.

Evaluate Schedule Properties:

  • Recoverability: Since there are no dirty reads, no transaction reads uncommitted changes. Therefore, SS is recoverable.
  • Cascading Aborts: A cascading abort occurs when the abort of one transaction forces another transaction to abort because of dirty read dependencies. Because no dirty reads exist, the abort of T1T_1 does not cause T2T_2 to abort. The abort a2a_2 is independent. Thus, SS does not have a cascading abort.
  • Strictness: A schedule is strict if a transaction neither reads nor writes a data item until the last transaction that wrote it has committed or aborted. Here, T1T_1 writes XX at step 4, and T2T_2 writes XX at step 6 before T1T_1 aborts at step 7. Therefore, SS is not strict.

Therefore, statement C ('SS does not have a cascading abort') is TRUE.

Final answer

C

Common trap

Assuming that w2(X)w_2(X) after w1(X)w_1(X) is a read operation or causes cascading aborts, confusing write-write conflicts with dirty reads.

The answer is the one in the official GATE answer key. The solution is this site's own explanation.

Source

Paper
GATE 2016 Computer Science and Information Technology (CS) Session 2
Question
61 of 65, printed as CS Q.51
Section
Computer Science and Information Technology

Report an error in this question

GATE questions are the work of the organising institutes. This site is independent and is not affiliated with them.