Question

Consider the following transaction involving two bank accounts xx and yy.

read(x);  x:=x−50;  write(x);  read(y);  y:=y+50;  write(y)\text{read}(x);\; x := x - 50;\; \text{write}(x);\; \text{read}(y);\; y := y + 50;\; \text{write}(y)

The constraint that the sum of the accounts xx and yy should remain constant is that of

Choose one option
Official answer and solution
Official answer
B
From
Official GATE 2015 answer key

Solution

Recall the definitions of ACID properties in transaction processing.

ACID properties define transaction correctness in database systems:

  • Atomicity: An 'all-or-nothing' execution guarantee.
  • Consistency: The requirement that an execution of a transaction in isolation preserves database integrity constraints and business rules.
  • Isolation: Each transaction executes unaware of concurrently executing transactions.
  • Durability: Committed changes persist indefinitely even across system crashes.

Here, the requirement that the total money in the system (x+yx + y) remains constant before and after the transfer represents an explicit integrity constraint (an application consistency invariant).

Therefore, preserving this sum is the responsibility of the Consistency property.

Final answer

B

Common trap

Confusing Atomicity (all operations execute or none do) with Consistency (preserving domain-specific invariants like account sum conservation).

The answer is the one in the official GATE answer key. The solution is this site's own explanation.

Source

Paper
GATE 2015 Computer Science and Information Technology (CS) Session 2
Question
11 of 65, printed as CS Q.1
Section
Computer Science and Information Technology

Report an error in this question

GATE questions are the work of the organising institutes. This site is independent and is not affiliated with them.