Prove that the basic two-phase locking protocol guarantees conflict serializability of schedules. (Hint: Show that, if a serializability graph for a schedule has a cycle, then at least one of the transactions participating in the schedule does not obey the two-phase locking protocol.)
What will be an ideal response?
(This proof is by contradiction, and assumes binary locks for simplicity. A similar
proof can be made for shared/exclusive locks.)
Suppose we have n transactions T1, T2, ..., Tn such that they all obey the basic
two-phase locking rule (i.e. no transaction has an unlock operation followed by a lock
operation). Suppose that a non-(conflict)-serializable schedule S for T1, T2, ..., Tn
does occur; then, according to Section 17.5.2, the precedence (serialization) graph for
S must have a cycle. Hence, there must be some sequence within the schedule of the form:
S: ...; [o1(X); ...; o2(X);] ...; [ o2(Y); ...; o3(Y);] ... ; [on(Z); ...; o1(Z);]...
where each pair of operations between square brackets [o,o] are conflicting (either [w,
w], or [w, r], or [r,w]) in order to create an arc in the serialization graph. This
implies that in transaction T1, a sequence of the following form occurs:
T1: ...; o1(X); ... ; o1(Z); ...
Furthermore, T1 has to unlock item X (so T2 can lock it before applying o2(X) to follow
the rules of locking) and has to lock item Z (before applying o1(Z), but this must occur
after Tn has unlocked it). Hence, a sequence in T1 of the following form occurs:
T1: ...; o1(X); ...; unlock(X); ... ; lock(Z); ...; o1(Z); ...
This implies that T1 does not obey the two-phase locking protocol (since lock(Z) follows
unlock(X)), contradicting our assumption that all transactions in S follow the two-phase
locking protocol.
You might also like to view...
Which statement below is false?
a. Structured programming produces programs that are easier to test. b. Structured programming requires four forms of control. c. Structured programming produces programs that are easier to modify d. Structured programming promotes simplicity.
The maximum number if rows in OpenOffice Calc is over one million
Indicate whether the statement is true or false
Case-Based Critical Thinking Questions ? Case 7-2 Rina has just completed some coursework in Excel application writing and wants to begin developing her own macros to share more widely. She knows that she has to learn more about digital signatures in order to make her plan a reality. ? ? By digitally signing a workbook that contains a macro that she intends to publicly distribute, Rina assures her audience _____.
A. of the identity of the user of the macro B. that the macro has not been altered since the digital signature was created C. that the macro will perform as expected D. that no data entry errors will stop the macro from running
Find an equation of a line given the following information. The final answer should be left in slope-intercept form. Passes through the point and is parallel to the line
What will be an ideal response?