← RGPV CS-502 DBMS June 2026 solved question paper
← RGPV CS-502 DBMS December 2025 solved question paper
← RGPV CS-502 DBMS May 2024 solved question paper
← RGPV CS-502 DBMS November 2019 solved question paper
RGPV CS-502 (GS) | June 2026 | Q7(b) | 7 marks (inferred)
Question (restated): Discuss locking protocols, timestamp ordering and checkpoints.
Answer

Locking coordinates concurrent access. Shared locks permit concurrent readers; exclusive locks prevent conflicting reads and writes. Two-phase locking (2PL) has a growing phase acquiring locks and a shrinking phase releasing locks. It guarantees conflict serializability but may cause deadlocks. Strict 2PL holds exclusive locks until commit or abort, simplifying recovery. Deadlocks can be detected using a wait-for graph or avoided through ordering policies.
Timestamp ordering assigns each transaction a unique timestamp TS. Each item X maintains read_TS(X) and write_TS(X). A read by T is rejected if TS(T) is less than write_TS(X); otherwise it updates read_TS. A write is rejected in basic timestamp ordering if TS(T) is less than read_TS(X) or write_TS(X); otherwise it proceeds and updates write_TS. This enforces timestamp order without lock waiting in the basic protocol, but repeated aborts may occur. Strict variants address recoverability.
For example, T1 has timestamp 10 and T2 has timestamp 20. If T2 writes X first, a subsequent read of X by T1 violates timestamp order and T1 must restart. Under locking, T1 might instead wait for an incompatible lock to be released.
Checkpoints are recovery mechanisms, not concurrency protocols. A checkpoint records recovery-related state in the log, such as active transactions and dirty pages in an ARIES-style fuzzy checkpoint. Write-ahead logging requires relevant log records to reach stable storage before corresponding dirty pages and commit acknowledgement requires durable commit information. After a crash, checkpoint information helps bound recovery work; redo and undo depend on the recovery algorithm. A checkpoint is not a substitute for a backup.
December 2025 – Q7(a)
Question (restated): Explain concurrency control using locking and timestamp protocols.
Concurrency control coordinates simultaneous transactions to prevent lost updates and inconsistent reads. Shared locks permit concurrent readers; exclusive locks prohibit other shared or exclusive locks on the same item. Two-phase locking (2PL) has a growing phase in which locks are acquired and a shrinking phase in which locks are released. It guarantees conflict serializability but can cause deadlocks. Strict 2PL holds exclusive locks until commit or abort, preventing other transactions from reading uncommitted writes.
Timestamp ordering assigns each transaction a unique timestamp TS. Each item X maintains read timestamp RTS(X) and write timestamp WTS(X). A read by T is rejected if TS(T) < WTS(X); otherwise RTS(X) is updated to the maximum. A write is rejected if TS(T) < RTS(X) or TS(T) < WTS(X) under basic timestamp ordering; otherwise it proceeds and updates WTS(X).
For example, if T2 has timestamp 20 and has written X, a read by older T1 with timestamp 10 is rejected and T1 restarts. Basic timestamp ordering avoids lock deadlocks but may cause repeated aborts. Locking can wait rather than abort immediately; deadlock detection or prevention is required. Both methods aim to enforce a consistent serialization order.
May 2024 — Q6(b)
Question (restated): Explain concurrency control using locking methods.
Answer
Lock-based concurrency control regulates conflicting access. Shared (S) locks allow concurrent reads; exclusive (X) locks prevent other shared or exclusive locks on the same item. A transaction requests a lock before accessing an item and waits if incompatible. Two-phase locking requires all acquisitions before the first release and guarantees conflict serializability. Strict 2PL holds exclusive locks until completion, preventing dirty reads of its writes. Lock granularity may be row, page or table; intention locks coordinate hierarchical locking. For example, T1 acquires X(A), updates A, commits and releases it; T2 requesting S(A) waits and then reads the committed value. Deadlock can arise if T1 holds A and requests B while T2 holds B and requests A. A wait-for graph detects cycles; aborting a victim releases locks. Predicate or range locks may be needed to prevent phantoms.

November 2019 – Question 7(a)
Question (restated): Discuss strict two-phase locking and timestamp-based protocols.
Answer
Strict 2PL follows growing and shrinking phases and holds exclusive locks until commit or abort. This prevents other transactions from reading or overwriting uncommitted writes and produces strict, conflict-serializable schedules. Rigorous 2PL holds shared locks until completion as well. Deadlocks remain possible.
Basic timestamp ordering assigns TS(T) to each transaction and maintains read_TS(X) and write_TS(X). A read is rejected if TS(T) is less than write_TS(X); otherwise read_TS is updated. A write is rejected if TS(T) is less than read_TS(X) or write_TS(X); otherwise the write and write_TS update proceed. Rejected transactions abort and may restart. For example, if T2 with timestamp 20 writes X, T1 with timestamp 10 cannot subsequently read X under basic timestamp ordering. The protocol avoids lock deadlocks but can cause repeated aborts.
← RGPV CS-502 DBMS June 2026 solved question paper
← RGPV CS-502 DBMS December 2025 solved question paper
Discussion
Ask a question, share your thoughts or report an error.
Sign in to participate in the discussion.
Join the discussion