search
Log In
20 votes
7.8k views

Consider the following two statements about database transaction schedules:

  1. Strict two-phase locking protocol generates conflict serializable schedules that are also recoverable.
  2. Timestamp-ordering concurrency control protocol with Thomas’ Write Rule can generate view serializable schedules that are not conflict serializable

Which of the above statements is/are TRUE?

  1. I only
  2. II only
  3. Both I and II
  4. Neither I nor II
in Databases
edited by
7.8k views

4 Answers

39 votes
 
Best answer
  1. Strict 2PL allows only schedules whose precedence graph is acyclic i.e. schedule is Conflict Serial. In 2PL, transactions do not release exclusive locks until the transaction has committed or aborted i.e. schedule is recoverable.
  2. Time stamp ordering schedule with Thomas write rule generate View serial schedule with BLIND WRITE. Because of BLIND WRITE it won't be Conflict Serial.

So, Option C - both are true


edited by
0
sir, for first option, all those are recoverable too ?
6
2PL only releases locks when a transaction ends. It prevents a transaction from accessing a database object that was modified by a prior transaction that aborts.
1
Time Stamp with Thomas Write rule means RW and WR conflict will not be there.That means view serializability?
1
Isn't the case that if a schedule satisfy any 2PL it is a conflict  serialize schedule?
1
If a schedule is not serializeable then it cannot be 2PL.
2
"Because of BLIND WRITE it won't be Conflict Serial."

Transaction having Blind write then it will not be CS?how? 

T1         T2

R(A)

             W(A)

W(B)

0

@user2525 aren't all view serializable schedules-- conflict serializable?
then how b can be true?

0

@manisha11

all confilict serializable schedules are view serializable.

1

Because of BLIND WRITE, it won't be Conflict Serial.

I think this statement is incorrect.

0

The write operations in your example are on different variables. How does that make a blind write?

0
@Nitesh singh2

I also have this same doubt.
0

@ Sir, 

In 2PL, transactions do not release exclusive locks until the transaction has committed or aborted i.e. schedule is recoverable.

Isn’t it should be Strict 2PL instead of 2PL?  

5 votes

In strict 2PL, a transaction T does not release any of its exclusive (write) locks until after it commits or aborts.
Hence, no other transaction can read or write an item that is written by T unless T has committed, leading to a strict schedule for recoverability.
(Ref: Fundamentals of Database Systems by Elmasri and Navathe, 7e Pg. No. 789)

By ignoring the write, Thomas write rule allows schedules that are not conflict serializable but are nevertheless correct.
Those non-conflict-serializable schedules allowed satisfy the definition of view serializable schedules.
(Ref: Database System Concepts by Silberschatch, Korth and Sudarshan, 6e Pg No. 686)

4 votes

A strict 2PL protocol has both a growing phase and a shrinking phase. In the growing phase, it acquires locks; in the shrinking phase, it only releases shared locks. The exclusive locks are released after the transaction commits.

=> There can be no dirty reads by other transactions. 

=> No cascading rollbacks or aborts.

=> recoverable.



The basic timestamp ordering protocol enforces conflict serialisability.

Thomas write rule enforces view serialisability. It does so by ignoring the blind writes. The blind writes are meaningless operations that prevent a serial to be conflict serialisable; but by ignoring them, we can make them view serialisable.

 

Hence, both are true.

Option C

2 votes

Answer: (C)

 

In strict 2PL, a transaction T does not release any of its exclusive (write) locks until after it commits or aborts.

Hence, no other transaction can read or write an item that is written by T unless T has committed, leading to a strict schedule for recoverability.

-> (Ref: Fundamentals of Database Systems by Elmasri and Navathe, 7e Pg. No. 789)

By ignoring the OUTDATED write, Thomas write rule allows schedules that are not conflict serializable but are nevertheless correct.

Those non-conflict-serializable schedules allowed satisfy the definition of view serializable schedules.

-> (Ref: Database System Concepts by Silberschatch, Korth and Sudarshan, 6e Pg No. 686)

 

PROOF  OF STATEMENT 2 :

Eg:

T1                    T2                         T3

r(a)      

                       w(a) 

                                                    r(a)

w(a)

                                                     w(a)

This Schedule Is View Serializable but not Conflict Serializable . CHECK IT.

It Is View Serializable To T1T2T3, with T2 having a Blind Write.

 

NOW SOLVING BY THOMAS WRITE RULE:

-> By TimeStamp Ordering , Correct Order Is : T1T2T3.

-> But CONFLICT w2(a)r1(a) is not in Timestamp order.

-> But Thomas write rule can ignore it as this is Outdated Write. So w1(a) can be completely IGNORED from The Transaction .

-> Other Remaining Conflicts (with w1(a) discarded) are r1(a)w3(a), w2(a)r3(a),w2(a)w3(a) which are in Correct Timestamp Order.

-> Thus after ignoring 1 OUTDATED WRITE , THOMAS WRITE RULE ACCEPTED A SCHEDULE WHICH IS VIEW SERIALIZABLE AND NOT CONFLICT SERIALIZABLE.


edited by
Answer:

Related questions

12 votes
3 answers
1
4.6k views
Which one of the following statements is NOT correct about the B+ tree data structure used for creating an index of a relational database table? B+ Tree is a height-balanced tree Non-leaf nodes have pointers to data records Key values in each node are kept in sorted order Each leaf node has a pointer to the next leaf node
asked Feb 7, 2019 in Databases Arjun 4.6k views
15 votes
1 answer
2
5.1k views
Let the set of functional dependencies $F=\{QR \rightarrow S, \: R \rightarrow P, \: S \rightarrow Q \}$ hold on a relation schema $X=(PQRS)$. $X$ is not in BCNF. Suppose $X$ is decomposed into two schemas $Y$ and $Z$, where $Y=(PR)$ and $Z=(QRS)$ ... $Y$ and $Z$ is dependency preserving and lossless Which of the above statements is/are correct? Both I and II I only II only Neither I nor II
asked Feb 7, 2019 in Databases Arjun 5.1k views
20 votes
4 answers
3
10.6k views
A relational database contains two tables Student and Performance as shown below: ... Marks) FROM Student S, Performance P WHERE P.Marks >84 GROUP BY S.Student_name; The number of rows returned by the above SQL query is ________
asked Feb 7, 2019 in Databases Arjun 10.6k views
20 votes
2 answers
4
6.2k views
Consider the following relations $P(X,Y,Z), Q(X,Y,T)$ and $R(Y,V)$ ... Answer: ________
asked Feb 7, 2019 in Databases Arjun 6.2k views
...