Transactions, Concurrency Control and Recovery Pyqs for Gate Cs
Solve 11+ Transactions, Concurrency Control and Recovery previous year questions for GATE CS with answers and detailed solutions. Free sample questions below.
Try a question
Answer it here to see how it works. Nothing is recorded until you sign in.
Question 1
2026 Slot Set2 PYQ
Level 3: Exam Standard
Consider concurrent execution of two transactions T1 and T2 in a DBMS, both of which access a data object A. For these two transactions to not conflict on A, which one of the following statements must be true?
Question 2
2025 Slot Set2 PYQ
Level 3: Exam Standard
An audit of a banking transactions system has found that on an earlier occasion, two joint holders of account A attempted simultaneous transfers of Rs. 10000 each from account A to account B. Both transactions read the same value, Rs. 11000, as the initial balance in A and were allowed to go through. B was credited Rs. 10000 twice. A was debited only once and ended up with a balance of Rs. 1000.
Which of the following properties is/are certain to have been violated by the system?
Question 3
2025 Slot Set2 PYQ
Level 3: Exam Standard
Consider the database transactions T1 and T2, and data items X and Y. Which of the schedule(s) is/are conflict serializable?
Question 4
2025 Slot Set1 PYQ
Level 3: Exam Standard
A schedule of three database transactions T1, T2, and T3 is shown. Ri(A) and Wi(A) denote read and write of data item A by transaction Ti, i=1,2,3. The transaction T1 aborts at the end. Which other transaction(s) will be required to be rolled back?
R1(X)W1(Y)R2(X)R2(Y)R3(Y)ABORT(T1)
Question 5
2024 Slot Set2 PYQ
Level 3: Exam Standard
Which of the following statements about the Two Phase Locking (2PL) protocol is/are TRUE?
Question 6
2024 Slot Set2 PYQ
Level 3: Exam Standard
Once the DBMS informs the user that a transaction has been successfully completed, its effect should persist even if the system crashes before all its changes are reflected on disk. This property is called
Question 7
2024 Slot Set1 PYQ
Level 3: Exam Standard
Consider the following read-write schedule S over three transactions T1,T2, and T3, where the subscripts in the schedule indicate transaction IDs:
Which of the following transaction schedules is/are conflict equivalent to S ?
Question 8
2022 PYQ
Level 3: Exam Standard
Let Ri(z) and Wi(z) denote read and write operations on a data element z by a transaction Ti, respectively. Consider the schedule S with four transactions.
Which one of the following serial schedules is conflict equivalent to S?
Question 9
2021 Slot Set2 PYQ
Level 3: Exam Standard
Let S be the following schedule of operations of three transactions T1, T2 and T3 in a relational database system:
R2(Y),R1(X),R3(Z),R1(Y),W1(X),R2(Z),W2(Y),R3(X),W3(Z) Consider the statements P and Q below:
P: S is conflict-serializable. Q: If T3 commits before T1 finishes, then S is recoverable.
Which one of the following choices is correct?
Question 10
2021 Slot Set1 PYQ
Level 3: Exam Standard
Let ri(z) and wi(z) denote read and write operations respectively on a data item z by a transaction Ti. Consider the following two schedules.
S1:r1(x)r1(y)r2(x)r2(y)w2(y)w1(x) S2:r1(x)r2(x)r2(y)w2(y)r1(y)w1(x) Which one of the following options is correct?
Free preview ends here
Login to view the complete previous-year questions and solutions
Creating an account is free. You get the rest of this chapter, step-by-step solutions, and a study plan built around the topics you are actually weak at.
Most platforms hand everyone the same content. Here the content moves with your performance, topic by topic.
Built around you, not around a syllabus PDF
Every answer you give moves your topic-level intelligence rate. The next question, the next revision card and tomorrow's plan all change with it.
Revision that hits your weak spots
We only revise topics you have actually attempted and are still below the safe bar on — never the same chapter on repeat.
Questions calibrated to the real exam
Each question carries a measured toughness. You are served a rung above your current level, so practice keeps stretching you.
Notes written for recall, not for volume
Full lesson cards for first study, curated short-note cards for the last mile — with derivations, traps and exam patterns marked.
One place for everything
Notes, chapter practice, previous-year questions, test series and full-length papers — all feeding one picture of your preparation.
Honest progress
No vanity streaks. Progress here means chapters mastered and accuracy that held up on harder questions.
Unlock the whole course
Full notes and short notes, the complete question bank with worked solutions, mock tests, full-length papers, and an adaptive plan that rebuilds itself as you improve.
Transactions, Concurrency Control and Recovery PYQs for GATE CS
Solve 11+ Transactions, Concurrency Control and Recovery previous year questions for GATE CS with answers and detailed solutions. Free sample questions below.
Chapter Roadmap: Transactions, Concurrency, and Recovery
1
ACID Properties and Concurrency Anomalies
The foundation. Defines the rules of reliability and the specific logical errors that occur when concurrent transactions interfere.
2
Conflict Serializability and Schedule Equivalence
The mathematical test. How to prove that an interleaved execution is logically equivalent to a safe, serial execution.
3
Recoverability, Cascading Rollback, and Crash Recovery
Handling failures. Ensuring that aborted transactions do not corrupt committed ones, and the database can restart cleanly.
4
Two-Phase Locking and Lock-Based Concurrency Control
The practical protocol. The actual mechanism databases use to guarantee serializability and prevent anomalies in real time.
The Transaction: A Logical Unit of Work
A transaction is a logical unit of work that contains one or more database operations (reads and writes).
From the system's perspective, it is a sequence of low-level operations. From the user's perspective, it is a single, indivisible action.
Core Principle
A transaction must transition the database from one consistent state to another consistent state. It is the fundamental boundary for enforcing reliability, concurrency control, and recovery.
Example: A funds transfer is one transaction. It involves:
Read balance of Account A.
Subtract amount from Account A.
Write new balance to Account A.
Read balance of Account B.
Add amount to Account B.
Write new balance to Account B.
If any step fails, the entire transaction is treated as if it never happened.
Transactions, Concurrency Control and Recovery: Solved Questions with Step-by-Step Explanations (10 Problems)
Question 1 · Databases · 2026_Set2MCQ
Consider concurrent execution of two transactions T1 and T2 in a DBMS, both of which access a data object A. For these two transactions to not conflict on A, which one of the following statements must be true?
A.
Both T1 and T2 only read A
B.
T1 reads A and T2 writes A
C.
T1 writes A and T2 reads A
D.
Both T1 and T2 write A
Correct Answer:
A
Step-by-Step Solution
Insight: Conflicting operations require at least one write operation on the same data item by different transactions.
Exam route: Eliminate any option that includes a write operation on data object A.
Learning route:
Recall the definition of conflicting operations:
They belong to different transactions.
They access the same data item.
At least one of the operations is a Write.
The question asks for the condition where the two transactions do NOT conflict on A.
To avoid conflict, the third condition must be false. Therefore, neither transaction can perform a Write on A.
Both transactions must only read A.
Question 2 · Databases · 2025_Set2MSQ
An audit of a banking transactions system has found that on an earlier occasion, two joint holders of account A attempted simultaneous transfers of Rs. 10000 each from account A to account B. Both transactions read the same value, Rs. 11000, as the initial balance in A and were allowed to go through. B was credited Rs. 10000 twice. A was debited only once and ended up with a balance of Rs. 1000.
Which of the following properties is/are certain to have been violated by the system?
A.
Atomicity
B.
Consistency
C.
Isolation
D.
Durability
Correct Answer:
["B","C"]
Step-by-Step Solution
Insight: Simultaneous transfers reading the same initial balance and overwriting each other is a classic Lost Update, violating Isolation. The resulting mismatch in total funds violates Consistency.
Exam route: Check ACID properties. Lost update = Isolation violation. Total money not conserved = Consistency violation. No crash mentioned = Durability holds. Transactions completed = Atomicity holds.
Learning route:
Initial state: Account A = 11000.
T1 and T2 both read A = 11000.
T1 writes A = 1000. T2 writes A = 1000. (One update is lost; this is a Lost Update anomaly).
Account B is credited twice (+20000), but Account A is debited only once (-10000).
Total money increased by 10000, violating the consistency invariant (sum of balances must be constant).
The interleaving caused a Lost Update, which is a direct failure of Isolation.
Atomicity is not violated as the transactions were "allowed to go through" (committed). Durability is not relevant here as no crash occurred.
Question 3 · Databases · 2025_Set2MSQ
Consider the database transactions T1 and T2, and data items X and Y. Which of the schedule(s) is/are conflict serializable?
Insight: A schedule is conflict serializable if and only if its precedence graph is acyclic.
Exam route: For each option, build the precedence graph by checking all pairs of conflicting operations. If any cycle exists, reject it immediately.
Learning route:
Option A:
R1(X) before W2(X) => T1 -> T2
W1(Y) before W2(Y) => T1 -> T2
W2(X) before W1(X) => T2 -> T1
Cycle exists (T1 -> T2 -> T1). Not conflict serializable.
Option B:
W2(X) before R1(X) => T2 -> T1
W2(Y) before W1(Y) => T2 -> T1
W2(X) before W1(X) => T2 -> T1
All edges point from T2 to T1. No cycle. Conflict serializable (equivalent to T2 T1).
Option C:
R1(X) before W2(X) => T1 -> T2
W1(Y) before W2(Y) => T1 -> T2
W2(X) before W1(X) => T2 -> T1
Cycle exists. Not conflict serializable.
Option D:
W2(X) before R1(X) => T2 -> T1
W1(Y) before W2(Y) => T1 -> T2
Cycle exists. Not conflict serializable.
Question 4 · Databases · 2025_Set1MCQ
A schedule of three database transactions T1, T2, and T3 is shown. Ri(A) and Wi(A) denote read and write of data item A by transaction Ti, i=1,2,3. The transaction T1 aborts at the end. Which other transaction(s) will be required to be rolled back?
R1(X)W1(Y)R2(X)R2(Y)R3(Y)ABORT(T1)
A.
Only T2
B.
Only T3
C.
Both T2 and T3
D.
Neither T2 nor T3
Correct Answer:
C
Step-by-Step Solution
Insight: Cascading rollback is required when a transaction reads uncommitted (dirty) data from a transaction that subsequently aborts.
Exam route: Trace the read-from dependencies. If T_abort writes X, and T_other reads X before T_abort commits/aborts, T_other must be rolled back.
Learning route:
Identify the aborting transaction: T1 aborts at the end.
Identify what T1 wrote: T1 writes Y (W1(Y)).
Check for dirty reads:
T2 reads Y (R2(Y)) after W1(Y). This is a dirty read.
T3 reads Y (R3(Y)) after W1(Y). This is also a dirty read.
Since T1 aborts, the value of Y it wrote is invalid.
To prevent T2 and T3 from acting on invalid data, both must be rolled back (cascading rollback).
Therefore, both T2 and T3 are required to be rolled back.
Question 5 · Databases · 2024_Set2MSQ
Which of the following statements about the Two Phase Locking (2PL) protocol is/are TRUE?
A.
2PL permits only serializable schedules
B.
With 2PL, a transaction always locks the data item being read or written just before every operation and always releases the lock just after the operation
C.
With 2PL, once a lock is released on any data item inside a transaction, no more locks on any data item can be obtained inside that transaction
D.
A deadlock is possible with 2PL
Correct Answer:
["A","C","D"]
Step-by-Step Solution
Insight: Two-Phase Locking (2PL) guarantees conflict serializability and enforces a strict acquire-then-release phase order, but it inherently does not prevent deadlocks or cascading rollbacks.
Exam route: Evaluate each statement against the core 2PL rules: Growing phase (acquire only), Shrinking phase (release only), Serializability guarantee, and Deadlock possibility.
Learning route:
Statement A: 2PL is a sufficient condition for conflict serializability. Any schedule that strictly obeys the 2PL protocol is mathematically guaranteed to be conflict serializable. Thus, it permits only serializable schedules. (True)
Statement B: 2PL does not require releasing a lock immediately after an operation. Transactions can and usually do hold locks across multiple operations during the growing phase to maintain isolation. Releasing immediately after every operation describes a naive, highly restrictive strategy, not 2PL. (False)
Statement C: This is the exact definition of the shrinking phase. The moment a transaction releases its first lock (the lock point), it enters the shrinking phase and is strictly forbidden from acquiring any new locks. (True)
Statement D: 2PL regulates the order of lock acquisition and release to ensure serializability, but it does not prevent transactions from waiting on each other in a cycle (e.g., T1 holds X and wants Y, while T2 holds Y and wants X). Deadlocks are still possible and require separate detection or prevention mechanisms. (True)
Conclusion: Statements A, C, and D are true.
Question 6 · Databases · 2024_Set2MCQ
Once the DBMS informs the user that a transaction has been successfully completed, its effect should persist even if the system crashes before all its changes are reflected on disk. This property is called
A.
durability
B.
atomicity
C.
consistency
D.
isolation
Correct Answer:
A
Step-by-Step Solution
Insight: The ACID property that guarantees committed changes survive system crashes is Durability.
Exam route: Match the phrase "persist even if the system crashes" directly to the definition of Durability.
Learning route:
Analyze the scenario: A transaction is "successfully completed" (committed).
The effect must "persist even if the system crashes".
Review ACID properties:
Atomicity: All or nothing execution.
Consistency: Preserves database invariants.
Isolation: Concurrent transactions do not interfere.
Durability: Committed changes are permanent and survive crashes.
The scenario perfectly describes Durability.
Question 7 · Databases · 2024_Set1MSQ
Consider the following read-write schedule S over three transactions T1,T2, and T3, where the subscripts in the schedule indicate transaction IDs:
Which of the following transaction schedules is/are conflict equivalent to S ?
A.
T1T2T3
B.
T1T3T2
C.
T3T2T1
D.
T3T1T2
Correct Answer:
["B","C","D"]
Step-by-Step Solution
Insight: Conflict equivalence depends entirely on the precedence graph. If the graph is acyclic, any topological sort is a conflict-equivalent serial schedule.
Exam route: Identify all conflicting pairs (different transactions, same data, at least one write). Draw directed edges from the earlier to the later transaction. Find all valid topological sorts.
Learning route:
List operations per data item:
z: r1(z), w1(z) (only T1)
x: r2(x), w2(x) (only T2)
y: r3(y), w3(y), r2(y), w2(y)
Identify conflicts on y:
w3(y) precedes r2(y) => T3 -> T2
w3(y) precedes w2(y) => T3 -> T2
r3(y) precedes w2(y) => T3 -> T2
No conflicts involve T1, as it only accesses z.
The precedence graph has a single edge: T3 -> T2.
Topological sorts must have T3 before T2. T1 is independent and can be placed anywhere.
Valid orders: T1 T3 T2, T3 T1 T2, T3 T2 T1.
These match options B, C, and D.
Question 8 · Databases · 2022MCQ
Let Ri(z) and Wi(z) denote read and write operations on a data element z by a transaction Ti, respectively. Consider the schedule S with four transactions.
After T1, T3 has no remaining incoming edges ⟹ Next is T3.
After T3, T4 has no remaining incoming edges ⟹ Next is T4.
Finally, T2⟹ End with T2.
Valid order: T1→T3→T4→T2.
Question 9 · Databases · 2021_Set2MCQ
Let S be the following schedule of operations of three transactions T1, T2 and T3 in a relational database system:
R2(Y),R1(X),R3(Z),R1(Y),W1(X),R2(Z),W2(Y),R3(X),W3(Z) Consider the statements P and Q below:
P: S is conflict-serializable. Q: If T3 commits before T1 finishes, then S is recoverable.
Which one of the following choices is correct?
A.
Both P and Q are true.
B.
P is true and Q is false.
C.
P is false and Q is true.
D.
Both P and Q are false.
Correct Answer:
B
Step-by-Step Solution
Insight: Conflict serializability is determined by the absence of cycles in the precedence graph. Recoverability depends on the commit order relative to read-from dependencies.
Exam route: Build the precedence graph for statement P. Check read-from dependencies and commit order for statement Q.
Learning route:
Analyze conflicts in S for P:
W1(X) (pos 5) and R3(X) (pos 8): T1 -> T3
R1(Y) (pos 4) and W2(Y) (pos 7): T1 -> T2
R2(Z) (pos 6) and W3(Z) (pos 9): T2 -> T3
Graph edges: T1 -> T2, T2 -> T3, T1 -> T3. This graph is acyclic. Thus, P is true.
Analyze recoverability for Q:
T3 reads X, which was written by T1 (W1(X) at pos 5, R3(X) at pos 8).
For a schedule to be recoverable, the writing transaction (T1) must commit before the reading transaction (T3) commits.
Statement Q claims that if T3 commits before T1 finishes, S is recoverable. This violates the rule, making Q false.
Conclusion: P is true and Q is false.
Question 10 · Databases · 2021_Set1MCQ
Let ri(z) and wi(z) denote read and write operations respectively on a data item z by a transaction Ti. Consider the following two schedules.
S1:r1(x)r1(y)r2(x)r2(y)w2(y)w1(x) S2:r1(x)r2(x)r2(y)w2(y)r1(y)w1(x) Which one of the following options is correct?
A.
S1 is conflict serializable, and S2 is not conflict serializable.
B.
S1 is not conflict serializable, and S2 is conflict serializable.
C.
Both S1 and S2 are conflict serializable.
D.
Neither S1 nor S2 is conflict serializable.
Correct Answer:
B
Step-by-Step Solution
Insight: Conflict serializability is determined by checking for cycles in the precedence graph of each schedule.
Exam route: Build the precedence graph for S1 and S2 by identifying cross-transaction conflicts on x and y.
Learning route:
Analyze S1: r1(x)r1(y)r2(x)r2(y)w2(y)w1(x)
Conflict on y: r1(y) (T1) precedes w2(y) (T2) ⟹T1→T2
Conflict on x: r2(x) (T2) precedes w1(x) (T1) ⟹T2→T1
Result: Cycle (T1→T2→T1). S1 is NOT conflict serializable.
Analyze S2: r1(x)r2(x)r2(y)w2(y)r1(y)w1(x)
Conflict on y: w2(y) (T2) precedes r1(y) (T1) ⟹T2→T1
Conflict on x: r2(x) (T2) precedes w1(x) (T1) ⟹T2→T1
Result: No cycle (only T2→T1). S2 IS conflict serializable.
Conclusion: S1 is not conflict serializable, and S2 is conflict serializable.