Consider the partial Schedule involving two transactions and . Only the and the operations have been shown. The operation on data item is denoted by and operation on data item is denoted by .
Suppose that the transaction fails immediately after time instance 9. Which of the following statements is correct?
View worked solution
Answer: B
To determine the correct statement, let us analyze the dependencies and recoverability of the given schedule :
- Identify the Write-Read Dependency (Dirty Read):
- At time instance 2, transaction writes to data item (
write(A)). - At time instance 7, transaction reads data item (
read(A)). - Since reads a value of written by before has committed, has a dirty read dependency on ().
- At time instance 2, transaction writes to data item (
- Recoverability Condition:
A schedule is recoverable if, for every pair of transactions and such that reads a data item previously written by , the commit operation of appears before the commit operation of .
- Checking the Schedule:
- commits at time instance 8.
- has not committed by time instance 8 (and fails immediately after time instance 9).
- Since commits before , the recoverability condition is violated. Thus, schedule is non-recoverable.
- Impact of Failure:
When fails after time instance 9, it must be aborted and rolled back. However, has already committed at time instance 8. By the Durability property of ACID, a committed transaction's effects cannot be undone. Since we cannot abort to undo the dirty read, transaction atomicity cannot be ensured.
Therefore, Schedule is non-recoverable and cannot ensure transaction atomicity.
Free practice · Your answers on this page are not saved.
