Machine-translated by Google. Questions are authored in English.
Top

Discussion

Consider the following transaction involving two bank accounts x and y.

read(x); x := x - 50; write(x); read(y); y := y + 50; write(y)

The constraint that the sum of the accounts x and y should remain constant is that of

  • A.Atomicity
  • B.Consistency
  • C.Isolation
  • D.Durability

Answer: B

The constraint is that of Consistency.

Consistency means a transaction takes the database from one valid state to another, preserving its integrity constraints. Keeping the sum of x and y unchanged after moving 50 from one account to the other is exactly such a constraint.

Atomicity ensures both writes happen or neither does, isolation keeps concurrent transactions from seeing each other's intermediate states, and durability keeps committed results after a crash. None of them is the rule about the sum itself.

No comment is present. Be the first to comment.
Loading…

Post your comment

Please log in or register to post a comment.