← RGPV CS-502 DBMS December 2024 solved question paper
RGPV Previous Year Examination Question
B.Tech. V Semester | CS-502 (GS) | December 2024 | 6(a)
Question (restated): Describe timestamp-based protocols for concurrency control.
Answer
Timestamp ordering
Timestamp-based concurrency control assigns each transaction T a unique timestamp TS(T) when it begins. Older transactions have smaller timestamps. The protocol ensures that conflicting operations occur consistently with timestamp order, producing conflict-serializable schedules without using conventional locks.
Data item timestamps
Each item X maintains read_TS(X), the largest timestamp of any transaction that successfully read X, and write_TS(X), the largest timestamp of any transaction that successfully wrote X. Initially both may be zero.
Read rule
When T requests read(X), if TS(T) < write_TS(X), a younger transaction has already written X. The read would violate timestamp order, so T is aborted and restarted. Otherwise the read is allowed and read_TS(X) becomes max(read_TS(X), TS(T)).
Write rule
When T requests write(X), if TS(T) < read_TS(X), a younger transaction has already read a value that T should have overwritten; abort T. If TS(T) < write_TS(X), the write is obsolete and basic timestamp ordering aborts T. Otherwise perform the write and set write_TS(X) to TS(T).
Worked schedule
| Operation | Result |
|---|---|
| T2 reads X, TS=20 | read_TS(X)=20 |
| T1 writes X, TS=10 | 10 < 20; abort T1 |
| T2 writes X | write_TS(X)=20 |
The rejection prevents an older write from invalidating the younger transaction’s earlier read.
Variants and limitations
Thomas’s write rule ignores obsolete writes when the read-timestamp check passes, instead of aborting solely because a newer write exists. Strict timestamp ordering delays access to items written by uncommitted transactions to avoid cascading rollback. Basic timestamp ordering does not wait for locks and is deadlock-free, but repeated restarts may cause starvation and basic schedules need not be recoverable. It is useful where timestamp order and optimistic execution are appropriate.
Further reading
Silberschatz, Korth and Sudarshan, Database System Concepts; Elmasri and Navathe, Fundamentals of Database Systems.
Discussion
Ask a question, share your thoughts or report an error.
Sign in to participate in the discussion.
Join the discussion