retagged by
904 views
2 votes
2 votes

We are using timestamp-based concurrency control, and there are two transactions T1 and T2 with timestamps 100 and 200, respectively.

The following schedule is executed in the order shown below using time stamping protocols:

$r1(A); \ w1(A); \ r2(A); \ r2(B); \ w1(B); \ c1; \ w2(A); \ c2;$

Which of the following is TRUE about the above schedule?

  1. It is allowed under Basic Timestamp Ordering Protocol.
  2. It is not allowed under Basic Timestamp Ordering Protocol since T1 is rolled back.
  3. It is not allowed under Basic Timestamp Ordering Protocol, but is allowed under Thomas Write Rule.
  4. It is not allowed under Basic Timestamp Ordering Protocol and Thomas Write Rule, but is allowed under Multi-version Timestamp Ordering Protocol.
retagged by

1 Answer

Best answer
1 votes
1 votes

Given - Two transactions T1 and T2 with time-stamps 100 and 200, respectively. 

Timestamp ordering rule says :

if ri (x) and wj (x) are conflicting operations then ri (x) is processed before wj (x) iff ts(Ti ) < ts(Tj )

This is the table for given schedule :

T1: timestamp value

 T2 : timestamp value
r1(A);  101  
w1(A); 102  
   r2(A); 201
   r2(B); 202
w1(B); 103  
c1;  
   w2(A); 203
   c2;

T1 is rolled back as it is committed before complete  Write() operation of T2 ,  .. 

1. Whenever a transaction T issues a write_item(X) operation, the following is checked:

a. If read_TS(X) > TS(T) or if write_TS(X) > TS(T), then abort and roll back T and reject the operation.

This should be done because some younger transaction with a timestamp greater than TS(T)— and hence after T in the timestamp ordering—has already read or written the value of item X before T had a chance to write X, thus violating the timestamp ordering. 

2. Whenever a transaction T issues a read_item(X) operation, the following is checked:

a. If write_TS(X) > TS(T), then abort and roll back T and reject the operation. This should be done because some younger transaction with timestamp greater than TS(T)—and hence after T in the timestamp ordering—has already written the value of item X before T had a chance to read X.

Here Timestamp of T2 is 203 > Timestamp of T1 which is 103 so T is roll back .

 Transaction T not satisfying any one of the Basic timestamp ordering protocol , Thomas Write Rule and  Multi version Timestamp ordering protocol . 

Hence only option B is true .

selected by
Answer:

Related questions

1 votes
1 votes
1 answer
1
2 votes
2 votes
1 answer
2
Bikram asked Aug 26, 2017
332 views
Consider the following transaction involving two bank accounts $A$ and $B$.$\begin{array}{|l|} \hline \text{read(A);} \\ \hline A:=A-250; \\ \hline \text{write(A);} \\ \...
1 votes
1 votes
1 answer
3
Bikram asked Aug 26, 2017
316 views
A schedule with two transactions T1 and T2 is as mentioned below:$\begin{array}{|c|c|} \hline T1 & T2 \\ \hline \text{read(A)} & {} \\ \hline \text{write(A)} & {} \\ \hl...
3 votes
3 votes
2 answers
4