Transactions
The transaction is the bedrock of data integrity in multiuser databases and the foundation of all concurrency schemes. A transaction is defined as a single indivisible piece of work that affects some data. All of the modifications made to data within a transaction are either uniformly applied to a relational database with a COMMIT statement, or the data affected by the changes is uniformly returned to its initial state with a ROLLBACK statement. Once a transaction is committed, the changes made by that transaction become permanent and are made visible to other transactions and other users.
Transactions always occur over time, although most transactions occur over a very short period of time. Because the changes made by a transaction are not official until the transaction is committed, this means that each individual transaction must be isolated from the effects of other transactions. The mechanism used to enforce transaction isolation is the lock.