Transaction Homework Question 02
Transaction Homework Question 02
2. Which of the following scenarios may lead to an irrecoverable error in a database system? (1 point)
(A) A transaction writes a data item after it is read by an uncommitted transaction
(B) A transaction reads a data item after it is read by an uncommitted transaction
(C) A transaction reads a data item after it is written by an uncommitted transaction
(D) A transaction reads a data item after it is written by a committed transaction
2. Can two phase locking ensure both conflict serialzability and freedom from deadlock? How about time-
stamp ordering? Explain the reason. (1 points)
3. Consider the following schedule table. Apply the timestamp protocol. TS(T1)= 150, TS(T2)= 160. Fill the
values for W-timestamp(A) and R-timestamp(A). Finally, will T1 be accepted or rollback? Explain the reason.
(2 points)
4. Consider a concurrency control manager by timestamps. Below are several sequences of events, including
start events, where sti means that transaction Ti starts and coi means Ti commits. These sequences represent
real time, and the timestamp-based scheduler will allocate timestamps to transactions in the order of their
starts. In each case below, say what happens with the last request. You have to choose between one of the
following four possible answers:
5. 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).
Suppose that the transaction T1 fails immediately after time instance 9. Which one of the following
statements is correct? Explain the reason. (1 point)
(A) T2 must be aborted and then both T1 and T2 must be re-started to ensure transaction atomicity.
(B) Schedule S is non-recoverable and cannot ensure transaction atomicity.
(C) Only T2 must be aborted and then re-started to ensure transaction atomicity.
(D) Schedule S is recoverable and can ensure atomicity and nothing else needs to be done.