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

Module5 Time Stamp

The document outlines a series of transactions (T1, T2, T3) and their operations on variables A, B, and C, detailing the read and write timestamps (RTS and WTS). It describes the conditions for rolling back transactions based on timestamp comparisons for read and write operations. The final RTS and WTS values for A, B, and C are provided as 100, 300, 100 and 300, 200, 100 respectively.

Uploaded by

justice.chitra.v
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
0 views

Module5 Time Stamp

The document outlines a series of transactions (T1, T2, T3) and their operations on variables A, B, and C, detailing the read and write timestamps (RTS and WTS). It describes the conditions for rolling back transactions based on timestamp comparisons for read and write operations. The final RTS and WTS values for A, B, and C are provided as 100, 300, 100 and 300, 200, 100 respectively.

Uploaded by

justice.chitra.v
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Transaction 1: Transaction 2: Transaction 3:

T1 T2 T3
100 200 300
Older Younger Youngest
R(A)
R(B)
W(C)
R(B)
R(C)
W(B)
W(A)
R(A)
W(C)
R(B)
R(A)
` R(B)
`

A B C A B C
RTS 0 0 0
WTS 0 0 0 RTS 300 300 100

WTS 300 200 200

Check the conditions for Read Check the conditions for Write
a. If WTS(A) > TS(Ti),Rollback Ti. a. If RTS(A)>TS(Ti) then Rollback Ti
b. Otherwise execute R(A) operation b. If WTS(A)>TS(Ti) then Rollback Ti
c. Set RTS(A) = Max{RTS(A),TS(Ti)} c. Otherwise execute Write(A)
Operation
Set WTS(A)=TS(Ti)

R(A) executed first at T1, therefore compare 0<100 (time stamp at T1) and if the condition
passed, set RTS (A) =max{0, 100} and hence RTS (A) is 100.

R(B) Executed second at T2, therefore compare 0<200 (time stamp at T1) and if the
condition passed, set RTS (B) = max {0,200} and hence RTS (B) = 200

W(C) executed third at T1, therefore compare 0<100 (time stamp at T1) and if the condition
passed, set WTS (C) = max(0, 100} and hence WTS (C)=100
R(B) executed fourth (already once done at second), and the value is 200 stored already. Now
R(B) has 300. compare, R(B)=max{200, 300} and hence R(B)=300
Likewise, find the stamp value for all the operations
OP A B C
RTS 100 300 100
WTS 300 200 100

You might also like