Notes > Database Systems > Transaction Management and Concurrency Control
A Transaction is an action or series of actions, carried out by a user or application which can access or change the database contents. A transaction can be viewed as a single logical unit of work. Application programs make use of many transactions along with non-database processing in between these transactions.
A transaction should result in the transformation of the database from one consistent state to another. A transaction can result is success or failure. A successful transaction commits. This means that the database reaches a new consistent state. A failed transaction will be aborted and the database will be restored to the previous consistent state. A failed transaction is "rolled back" or undone. The DBMS is responsible for ensuring all updates associated with a transaction occur or, in the case of the transaction being aborted, all the changes must be undone (rolled back).
Aborted transactions are transactions which have been rolled back but can be restarted later. A committed transaction cannot be aborted.
Transactions have four basic properties which form the acronym "ACID"
- Atomicity (it is viewed as a single unit of work)
- Consistency (database must not be left in an inconsistent state)
- Independence (partial effects of incomplete transaction are not visible to other transactions)
- Durability (committed transactions result in permanent changes to the database state)
Concurrency Control is the process of managing / controlling simultaneous operations on the database. Concurrency control is required because actions from different users / applications taking place upon the database must not interfere.
Interleaving operations can lead to the database being left in an inconsistent state. Three potential problems which should be addressed by successful concurrency control are as follows:
- Lost update problem
- Uncommitted Dependency Problem
- Inconsistent Analysis Problem
The two main concurrency control techniques are Locking and Timestamping
Search for "Transaction Management and Concurrency Control" on:
eBay (UK) |
Search for "Transaction Management and Concurrency Control" on the rest of Computing Students: Transaction Management and Concurrency Control