An audit of a banking transactions system has found that on an earlier occasion, two joint holders of account attempted simultaneous transfers of Rs. each from account to account . Both transactions read the same value, Rs., as the initial balance in and were allowed to go through. was credited Rs. twice. was debited only once and ended up with a balance of Rs. .
Which of the following properties is/are certain to have been violated by the system?
View worked solution
Answer: B;C
To determine which ACID properties are violated, let us analyze the execution of the two concurrent transactions, and :
- Initial State: Balance of .
- Both and read the balance of as simultaneously.
- calculates the new balance of as and writes it. also credits to .
- calculates the new balance of as and writes it. also credits to .
- Final State: Balance of , and is credited with in total.
This scenario is a classic example of the Lost Update concurrency anomaly. Let us evaluate each ACID property:
-
Isolation (Violated):
Isolation requires that concurrent execution of transactions results in a state equivalent to some serial execution.
- If and executed serially, the first transaction would debit to . The second transaction would then read and either fail (due to insufficient funds) or debit to a negative balance ().
- Since the concurrent execution allowed both to proceed using the stale balance of , the schedule is not serializable. Thus, Isolation is violated.
-
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 was credited to account , but only was debited from account . This mismatch violates the fundamental consistency invariant of a banking system. Thus, Consistency is violated.
- Atomicity (Not Violated): Atomicity requires that either all operations of a transaction are completed, or none are. In this case, both and executed all of their respective write operations (debiting and crediting ) completely. There was no partial transaction execution.
- Durability (Not Violated): Durability guarantees that once a transaction commits, its updates survive any subsequent system failures. Since the incorrect final state (, 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.
