GATE 2015 CS (CS2) – Question 31
A transaction transfers money between accounts x,y:
read(x); x=x−50; write(x);
read(y); y=y+50; write(y);The requirement that x+y remain constant is a constraint of which transaction property?
Practise this question in The GATE Grind →
Show answer and explanation
Correct answer: (B) Consistency
Explanation
Consistency requires that a transaction preserve database integrity constraints when moving from one valid state to another. Conservation of the sum x+y is such an invariant. Atomicity concerns all-or-nothing execution, isolation concurrent interference, and durability persistence after commit. Thus B.