Database Reference
In-Depth Information
stamp(T2). The schedule consisting of the operations of T1 and T2 is shown below
in time sequence:
T1:
Read(D)
Write(D)
T2:
Write(D)
Let us apply the timestamp-ordering protocol to the schedule:
Read(D) of T1 succeeds.
Write(D) of T2 succeeds.
When T1 attempts to perform Write(D), Timestamp(T1) < Write-timestamp(D)
because Write-timestamp(D) was set to Timestamp(T2).
Therefore, Write(D) of T1 is rejected and the transaction must be aborted and restarted
with a new timestamp.
Examine the application of the protocol carefully. The timestamp-ordering pro-
tocol requires the rejection of T2 although it is unnecessary. See what has happened
to D. T2 had already written D; the value T1 wants to write to D will not be required
to be read. Any transaction Tn earlier than T2 attempting to read D will be aborted
because Timestamp(Tn) < Write-timestamp(D). Any transaction Tn with Time-
stamp(Tn) > Timestamp(T2) must read D as written by T2 rather than the value of
D written by T1. Therefore, the write operation of T1 may be ignored.
What you have reviewed here leads us to a modified version of the timestamp-
ordering protocol in which certain obsolete write operations may be ignored. The
modified version has no changes for read operation. The modified version for write
operation of the timestamp-ordering protocol incorporates Thomas's Write Rule as
follows:
T issues write(D)
(a) Timestamp(T) < Read-timestamp(D)
T asks to write D that has already been read by a younger or later transaction.
This means that a later transaction is already using the value of D and it would
be incorrect to update D now. T is too late to attempt to write D.
Reject write operation. Abort T and restart it with a new timestamp.
(b) Timestamp(T) > Write-timestamp(D)
T asks to write D that has been updated by a younger or later transaction. This
means that T is attempting to override the value of D with an obsolete value.
Ignore write operation.
(c) Otherwise, when (a) and (b) are not true
Execute write operation. Set Write-timestamp(D) to Timestamp(T).
Optimistic Techniques
Review the types of processing done while using lock-based or timestamp-ordering
protocols. Before each database operation gets performed, some verification has to
be done to ensure that the operation will not cause a conflict. This results in system
overhead during transaction execution through locking or time-stamping and slows
the transaction down. In database environments where conflicts among transactions
Search WWH ::




Custom Search