0% found this document useful (0 votes)
220 views

Transaction Homework Question 02

This document contains a homework assignment on transaction management from the Department of Computer Science at the University of Helsinki. It includes 5 questions related to transaction schedules, conflict serializability, concurrency control, and ensuring atomicity. Students are asked to draw precedence graphs, determine if schedules are conflict serializable, identify which scenarios can lead to irrecoverable errors, explain timestamp ordering protocols, and determine how to ensure atomicity when transactions fail.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
220 views

Transaction Homework Question 02

This document contains a homework assignment on transaction management from the Department of Computer Science at the University of Helsinki. It includes 5 questions related to transaction schedules, conflict serializability, concurrency control, and ensuring atomicity. Students are asked to draw precedence graphs, determine if schedules are conflict serializable, identify which scenarios can lead to irrecoverable errors, explain timestamp ordering protocols, and determine how to ensure atomicity when transactions fail.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Spring 2019 Homework 2 Department of Computer Science

Transaction management University of Helsinki

Please answer all questions.


1. For each of the following transaction schedules, draw the precedence graph and decide if the schedule
is conflict-serializable. If the schedule is conflict-serializable, give an equivalent serial schedule by
listing the serial order of transactions. If the schedule is not conflict-serializable, explain why. (2
points)

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)

Steps T1 T2 W-timestamp(A) R-timestamp(A)


Initial 0 0
1 Read A ? ?
2 Read A ? ?
3 A=A+1 NA NA
4 A= A*2 NA NA
5 WRITE A ? ?
6 WRITE A

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:

(i) the request is accepted,

(ii) the request is ignored,

(iii) the transaction is delayed,

(iv) the transaction is rolled back.

(a) st1; st2; r1(A); r2(A); w1(B); w2(B); (0.5 point)

(b) st1; st2; r2(A); co2; r1(A); w1(A) (0.5 point)

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.

You might also like