Data Access and Transactions

Previous Topic Next Topic

Transactions Explained

A transaction, simply put, is an “all or nothing” sequence of database transformations. No modifications are committed to the database until all steps of the transaction have completed successfully. If any of the actions cannot be completed, the entire transaction is automatically “rolled back,” or undone. Transactions are a technique applied to guarantee the “correctness” of database operations.

The properties of transactions are collectively known by the acronym ACID:

At the most basic level, transactions ensure that data is protected from accidental modifications that would invalidate it. If an event occurs that upsets the intended sequence of changes, all the previous changes can be undone to restore the database to its original form. What happens if the second (or third) update fails? What if the application that is making changes crashes? What if the computer is accidentally turned off? Transactions that are stopped short are guaranteed to have no lasting effect on your data.

A transaction defines a boundary that encapsulates several database interactions and makes them appear as a single atomic interaction. Once a transaction has begun, an application can make changes to multiple records, and the effect of these changes is isolated from the rest of the database and from other users. When the transaction is committed, all the changes appear to happen simultaneously, in such a way as to guarantee that no data is lost or compromised.

Although transactions are important in commerce, transactions aren’t just about money. They arbitrate the contention that occurs with demand for any “hard” resource that cannot be created or destroyed.

See the following:


© 1997-1999 Microsoft Corporation. All rights reserved.