Consider the following partial Schedule S involving two transactions T1 and T2. Only the read and the write operations have been shown. The read operation on data item P is denoted by read(P) and the write operation on data item P is denoted by write(P) Time Instance Transaction-id T1 T2 1 read(A) 2 write(A) 3 read(C) 4 write(C) 5 read(B) 6 write(B) 7 read(A) 8 Commit 9 read(B) Schedule S Suppose that the transaction T1 fails immediately after time instance 9. Which one of the following statements is correct?
Consider the following partial Schedule S involving two transactions T1 and T2. Only the read and the write operations have been shown. The read operation on data item P is denoted by read(P) and the write operation on data item P is denoted by write(P) Time Instance Transaction-id T1 T2 1 read(A) 2 write(A) 3 read(C) 4 write(C) 5 read(B) 6 write(B) 7 read(A) 8 Commit 9 read(B) Schedule S Suppose that the transaction T1 fails immediately after time instance 9. Which one of the following statements is correct? Correct Answer Schedule S is non-recoverable and cannot ensure transaction atomicity
Concept:
Recoverable schedule: A schedule is said to be recoverable in which for every transaction Ti and Tj , if Tj is reading a data item that is written by Ti then the commit operation of Ti must before the commit operation of Tj.
Aborting: Aborting means to disrupt the action by killing the current ongoing transaction.
Explanation:
Option 1: Incorrect
As, it is not giving any surety about T1, there is no commit in T1. Rolling back of T2 may not be required in this.
Option 2: Correct
In given schedule, T2 is reading data item A that is written by T1 so it means commit of T1 must before the commit of T2, but here in this schedule it is not happening. So, this is non – recoverable schedule. In this after T1 fails, if we want to undo all the operations, still we cannot undo a committed transaction. So, it cannot ensure transaction atomicity.
Option 3: Incorrect
It is redoing all the operations of T2. But in this, it is reading data item A that is written by T1 and T1 is not committed. So, it results in dirty read problem.
Option 4: Incorrect
Since Schedule S is non – recoverable. So, it is incorrect. Also, it cannot ensure atomicity.