Skip to content
Official PYQ · 2025

GATE CS 2025 Set 2 Q17 — Transactions and Concurrency Control

Explain with AI

​​​​An audit of a banking transactions system has found that on an earlier occasion, two joint holders of account AA attempted simultaneous transfers of Rs. 1000010000 each from account AA to account BB. Both transactions read the same value, Rs.1100011000, as the initial balance in AA and were allowed to go through. BB was credited Rs.1000010000 twice. AA was debited only once and ended up with a balance of Rs. 10001000.

Which of the following properties is/are certain to have been violated by the system?

Select all correct options
View worked solution

Answer: B;C

To determine which ACID properties are violated, let us analyze the execution of the two concurrent transactions, T1T_1 and T2T_2:

  • Initial State: Balance of A=Rs. 11000A = \text{Rs. } 11000.
  • Both T1T_1 and T2T_2 read the balance of AA as Rs. 11000\text{Rs. } 11000 simultaneously.
  • T1T_1 calculates the new balance of AA as 11000−10000=100011000 - 10000 = 1000 and writes it. T1T_1 also credits Rs. 10000\text{Rs. } 10000 to BB.
  • T2T_2 calculates the new balance of AA as 11000−10000=100011000 - 10000 = 1000 and writes it. T2T_2 also credits Rs. 10000\text{Rs. } 10000 to BB.
  • Final State: Balance of A=Rs. 1000A = \text{Rs. } 1000, and BB is credited with Rs. 20000\text{Rs. } 20000 in total.

This scenario is a classic example of the Lost Update concurrency anomaly. Let us evaluate each ACID property:

  1. Isolation (Violated): Isolation requires that concurrent execution of transactions results in a state equivalent to some serial execution.
    • If T1T_1 and T2T_2 executed serially, the first transaction would debit AA to Rs. 1000\text{Rs. } 1000. The second transaction would then read Rs. 1000\text{Rs. } 1000 and either fail (due to insufficient funds) or debit AA to a negative balance (Rs. −9000\text{Rs. } -9000).
    • Since the concurrent execution allowed both to proceed using the stale balance of Rs. 11000\text{Rs. } 11000, the schedule is not serializable. Thus, Isolation is violated.
  2. Consistency (Violated): Consistency ensures that a transaction transforms the database from one valid state to another, preserving all integrity constraints (such as the conservation of money during transfers).
    • Here, a total of Rs. 20000\text{Rs. } 20000 was credited to account BB, but only Rs. 10000\text{Rs. } 10000 was debited from account AA. This mismatch violates the fundamental consistency invariant of a banking system. Thus, Consistency is violated.
  3. Atomicity (Not Violated): Atomicity requires that either all operations of a transaction are completed, or none are. In this case, both T1T_1 and T2T_2 executed all of their respective write operations (debiting AA and crediting BB) completely. There was no partial transaction execution.
  4. Durability (Not Violated): Durability guarantees that once a transaction commits, its updates survive any subsequent system failures. Since the incorrect final state (A=1000A = 1000, BB credited twice) persisted successfully, durability was maintained.

Therefore, the properties certain to have been violated are Consistency and Isolation.

Free practice · Your answers on this page are not saved.

Published
Report a correction
Keep exploringMore Transactions and Concurrency Control questions