chapter

    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 and in a DBMS, both of which access a data object . For these two transactions to not conflict on , 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 attempted simultaneous transfers of Rs. 10000 each from account to account . Both transactions read the same value, Rs. 11000, as the initial balance in and were allowed to go through. was credited Rs. 10000 twice. 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?

    Transaction T1R1(X)W1(Y)R1(X)W1(X)COMMIT(T1)Transaction T2W2(X)W2(Y)COMMIT(T2)
    Question 4
    2025 Slot Set1 PYQ
    Level 3: Exam Standard
    A schedule of three database transactions , , and is shown. and denote read and write of data item by transaction , . The transaction aborts at the end. Which other transaction(s) will be required to be rolled back?

    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 over three transactions and , where the subscripts in the schedule indicate transaction IDs:

    Which of the following transaction schedules is/are conflict equivalent to ?

    Question 8
    2022 PYQ
    Level 3: Exam Standard
    Let and denote read and write operations on a data element by a transaction , respectively. Consider the schedule with four transactions.



    Which one of the following serial schedules is conflict equivalent to ?
    Question 9
    2021 Slot Set2 PYQ
    Level 3: Exam Standard
    Let be the following schedule of operations of three transactions , and in a relational database system:


    Consider the statements P and Q below:

    P: S is conflict-serializable.
    Q: If commits before finishes, then S is recoverable.

    Which one of the following choices is correct?
    Question 10
    2021 Slot Set1 PYQ
    Level 3: Exam Standard
    Let and denote read and write operations respectively on a data item by a transaction . Consider the following two schedules.



    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.

    Explore complete test series, official past papers, and chapter-wise study tools.

    Why MastersUp

    Personalised first. High quality throughout.

    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:

    1. Read balance of Account A.
    2. Subtract amount from Account A.
    3. Write new balance to Account A.
    4. Read balance of Account B.
    5. Add amount to Account B.
    6. 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_Set2 MCQ

    Consider concurrent execution of two transactions and in a DBMS, both of which access a data object . For these two transactions to not conflict on , which one of the following statements must be true?

    1. A.

      Both and only read

    2. B.

      reads and writes

    3. C.

      writes and reads

    4. D.

      Both and write

    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:

    1. 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.
    1. The question asks for the condition where the two transactions do NOT conflict on A.
    2. To avoid conflict, the third condition must be false. Therefore, neither transaction can perform a Write on A.
    3. Both transactions must only read A.
    Question 2 · Databases · 2025_Set2 MSQ
    An audit of a banking transactions system has found that on an earlier occasion, two joint holders of account attempted simultaneous transfers of Rs. 10000 each from account to account . Both transactions read the same value, Rs. 11000, as the initial balance in and were allowed to go through. was credited Rs. 10000 twice. 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?
    1. A.

      Atomicity

    2. B.

      Consistency

    3. C.

      Isolation

    4. 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:

    1. Initial state: Account A = 11000.
    2. T1 and T2 both read A = 11000.
    3. T1 writes A = 1000. T2 writes A = 1000. (One update is lost; this is a Lost Update anomaly).
    4. Account B is credited twice (+20000), but Account A is debited only once (-10000).
    5. Total money increased by 10000, violating the consistency invariant (sum of balances must be constant).
    6. The interleaving caused a Lost Update, which is a direct failure of Isolation.
    7. 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_Set2 MSQ
    Consider the database transactions T1 and T2, and data items X and Y. Which of the schedule(s) is/are conflict serializable?

    Transaction T1R1(X)W1(Y)R1(X)W1(X)COMMIT(T1)Transaction T2W2(X)W2(Y)COMMIT(T2)
    1. A.

      R1(X), W2(X), W1(Y), W2(Y), R1(X), W1(X), COMMIT(T2), COMMIT(T1)

    2. B.

      W2(X), R1(X), W2(Y), W1(Y), R1(X), COMMIT(T2), W1(X), COMMIT(T1)

    3. C.

      R1(X), W1(Y), W2(X), W2(Y), R1(X), W1(X), COMMIT(T1), COMMIT(T2)

    4. D.

      W2(X), R1(X), W1(Y), W2(Y), R1(X), COMMIT(T2), W1(X), COMMIT(T1)

    Correct Answer:

    ["B"]

    Step-by-Step Solution

    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:

    1. 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.

    1. 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).

    1. 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.

    1. 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_Set1 MCQ
    A schedule of three database transactions , , and is shown. and denote read and write of data item by transaction , . The transaction aborts at the end. Which other transaction(s) will be required to be rolled back?

    1. A.

      Only

    2. B.

      Only

    3. C.

      Both and

    4. D.

      Neither nor

    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:

    1. Identify the aborting transaction: T1 aborts at the end.
    2. Identify what T1 wrote: T1 writes Y (W1(Y)).
    3. 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.
    1. Since T1 aborts, the value of Y it wrote is invalid.
    2. To prevent T2 and T3 from acting on invalid data, both must be rolled back (cascading rollback).
    3. Therefore, both T2 and T3 are required to be rolled back.
    Question 5 · Databases · 2024_Set2 MSQ

    Which of the following statements about the Two Phase Locking (2PL) protocol is/are TRUE?

    1. A.

      2PL permits only serializable schedules

    2. 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

    3. 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

    4. 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:

    1. 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)
    2. 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)
    3. 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)
    4. 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_Set2 MCQ

    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

    1. A.

      durability

    2. B.

      atomicity

    3. C.

      consistency

    4. 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:

    1. Analyze the scenario: A transaction is "successfully completed" (committed).
    2. The effect must "persist even if the system crashes".
    3. 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.
    1. The scenario perfectly describes Durability.
    Question 7 · Databases · 2024_Set1 MSQ

    Consider the following read-write schedule over three transactions and , where the subscripts in the schedule indicate transaction IDs:

    Which of the following transaction schedules is/are conflict equivalent to ?

    1. A.

    2. B.

    3. C.

    4. D.

    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:

    1. 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)
    1. 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
    1. No conflicts involve T1, as it only accesses z.
    2. The precedence graph has a single edge: T3 -> T2.
    3. 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 · 2022 MCQ
    Let and denote read and write operations on a data element by a transaction , respectively. Consider the schedule with four transactions.



    Which one of the following serial schedules is conflict equivalent to ?
    1. A.

    2. B.

    3. C.

    4. D.

    Correct Answer:

    A

    Step-by-Step Solution

    Insight: The conflict-equivalent serial schedule is found by performing a topological sort on the precedence graph of the given schedule.

    Exam route: Identify all cross-transaction conflicts, draw the directed edges, and find the unique valid topological ordering.

    Learning route:

    1. Identify conflicts in S:
    2. Conflicts on x:
    • precedes
    • precedes

    (Note: are all reads, so no conflicts among them).

    1. Conflicts on y:
    • precedes
    • precedes
    • precedes
    1. Compile edges: , , , , .
    2. Topological sort:
    • has no incoming edges Start with .
    • After , has no remaining incoming edges Next is .
    • After , has no remaining incoming edges Next is .
    • Finally, End with .
    1. Valid order: .
    Question 9 · Databases · 2021_Set2 MCQ
    Let be the following schedule of operations of three transactions , and in a relational database system:


    Consider the statements P and Q below:

    P: S is conflict-serializable.
    Q: If commits before finishes, then S is recoverable.

    Which one of the following choices is correct?
    1. A.

      Both P and Q are true.

    2. B.

      P is true and Q is false.

    3. C.

      P is false and Q is true.

    4. 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:

    1. 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.

    1. 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_Set1 MCQ
    Let and denote read and write operations respectively on a data item by a transaction . Consider the following two schedules.



    Which one of the following options is correct?
    1. A.

      is conflict serializable, and is not conflict serializable.

    2. B.

      is not conflict serializable, and is conflict serializable.

    3. C.

      Both and are conflict serializable.

    4. D.

      Neither nor 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:

    1. Analyze S1:
    • Conflict on y: (T1) precedes (T2)
    • Conflict on x: (T2) precedes (T1)
    • Result: Cycle (). S1 is NOT conflict serializable.
    1. Analyze S2:
    • Conflict on y: (T2) precedes (T1)
    • Conflict on x: (T2) precedes (T1)
    • Result: No cycle (only ). S2 IS conflict serializable.

    Conclusion: S1 is not conflict serializable, and S2 is conflict serializable.

    More previous year questions (pyqs) in this unit