A Transaction consists of one or more changes to the database which take the database from once consistent state to another. Transactions have the following properties (ACID):
By organizing changes into transactions, a DBMS can successfully provide three of its facilities:
- Atomicity - If a transaction is made up of a number of component updates, then every update must take effect or none of them should take effect. The sum of money must not be debited without being credited or vice versa.
- Consistency - The total effect of all the components of the transaction must take the database from one consistent state to another. The total sum of money represented in the database must remain unchnaged.
- Isolation - Each transaction must not affect the smooth and correct running of any other transaction. Thus no two transactions are allowed to try to change the same account at the same time, for fear of corrupting each other.
- Durability - After the transaction has successfully completed, nothing will permit the changes to be lost - not even a system crash.
- Resilience is achieved by ensuring that all of the transactions which complete have their changes made permanent in some way before the crash, while the effects of any half-completed transactions are completely done.
- Concurrency is achieved by isolating each transaction through the use of locks. Each piece of data that the transaction is changing is made inaccessible to any other transaction and so no two transactions can conflict. Oh the other hand, transactions can jointly access data they are only going to read but not change. In this case, no transaction is permitted to try to change a piece of data that another transaction has locked for reading.
- Integrity is maintained since the effect of each transaction can be checked to verify that none of the constraints have ben violated at the end of the transaction. Violations may result in the transaction being aborted or in automatic or user-directed compensating actions.
Source: Object Databases, An ODMG Approach
Content of these pages are owned and copyrighted by the poster.