in Databases retagged by
362 views
0 votes
0 votes

Consider the schedule $S = \{R1(A),R2(B),W2(A),W1(A)\}$

Assume that Transaction T1 has started execution before Transaction T2.

Which of the following is TRUE in the above case?

  1. Allowed under Basic Timestamp Protocol, but not under Thomas Write Rule.
  2. Not allowed under Basic Timestamp Protocol, but allowed under Thomas Write Rule.
  3. Allowed under both Basic Timestamp Protocol and Thomas Write Rule.
  4. Not allowed under both Basic Timestamp Protocol and Thomas Write Rule.
in Databases retagged by
by
362 views

1 Answer

1 vote
1 vote
Best answer

The schedule written in the tabular form:

T1 T2
R(A)  
  R(B)
  W(A)
W(A)  

In Thomas' write rule, we "ignore the outdated updates".

Since T1 started execution first, so, the W1(A) (in the last row), is an outdated updated. This will be ignored in Thomas' write rule. But in the basic timestamp protocol, this will cause T1 to roll back.

So, correct option is (B)

selected by

4 Comments

If T1 started the transaction earlier it would have preference.. so after it executes read on A in the first row, subsequent writes on A by T2, would be a violation.. right?

Please tell me what I seem to be missing..
0
0
No. There will not be any violation. Since T1 has already done its job of reading A. So, if T2 writes it there won't be any problem. But if T1 tries to read again (after T2's write operation) then that is a problem. Because as T1 started first it should get the initial value every time it reads.

Now if T1 writes after T2's write then that is also a problem, because as T2 started after T1, the final value of A should be that of T2's write and not T1's.

So, in Thomas write rule we ignore this write since it is now obsolete, and not needed.

I hope this helps :)
5
5
Ahhh! Thank you for explaining this so patiently!
0
0
Answer:

Related questions