• Consistency:
– The consistency requirement here is that the
sum of A and B be unchanged by the
execution of the transaction.
– Without the consistency requirement, money
could be created or destroyed by the
transaction!
– It can be verified easily that, if the database
is consistent before an execution of the
transaction, the database remains consistent
after the execution of the transaction.
Atomicity:
– Suppose that, just before the execution of transaction Ti
,
the values of accounts A and B are $1000 and $2000,
respectively.
– Now suppose that, during the execution of transaction
Ti
, a failure occurs that prevents Ti
from completing its
execution successfully.
– Further, suppose that the failure happened after the
write(A) operation but before the write(B) operation.
– In this case, the values of accounts A and B reflected in
the database are $950 and $2000. The system
destroyed $50 as a result of this failure.
– In particular, we note that the sum A + B is no longer
preserved.