|
A transaction is a bundle of actions which are done within a database to bring it from one consistent state to a new consistent
state. In between the data are inevitable inconsistencies.
A transaction is atomic, which means it cannot be divided up any further. Within a transaction all or none of
the actions need to be carried out. Doing only a part of the actions would lead
to an inconsistent database state.
One example of a transaction is the transfer of an amount of money from
one bank account to another. The debit of the money from one account and the
credit of it to another account makes together a consistent transaction. This
transaction is also atomic. The debit or credit alone would both lead to an
inconsistent state. After finishing the transaction (debit and credit) the
changes to both accounts become persistent and the one who gave the money has
now less money on his account while the receiver has now a higher balance.
Try it using the buttons at the bottom to the left which allowing navigation through the steps of this example.