Java Reference
In-Depth Information
These requirements are handled by the Transaction Control Commands and the Data
Control Language, respectively. Since these topics require some explanation, the
respective sublanguages are reviewed in the appropriate sections below.
Transaction Management and the Transaction Control Commands
Transaction management refers to the capability of an RDBMS to execute database
commands in groups, known as transactions . A transaction is a group or sequence of
commands, all of which must be executed in order and all of which must completed
successfully.
The Transaction Control Commands are used to control transactions.
The ACID Test
A commonly used expression in data processing is the ACID test. The ACID test
defines a set of properties that a database management system must have in order to
be adequate for handling transactions. These properties are as follows:
 
Atomicity
 
Consistency
 
Isolation
 
Durability
A discussion of the preceding properties follows.
Atomicity
Transactions must be atomic . Specifically, a transaction must be executed in its
entirety and committed as a whole or rolled back as a whole, so that either all
changes that constitute a transaction take effect or none of them take effect. A classic
example of an atomic transaction is a transfer of funds from a checking account to a
savings account. Clearly, you want both the deduction from savings and the addition
to checking to take place, failing which, neither should take place. When atomicity is
not guaranteed, you have an accounting nightmare.
Consistency
The consistency requirement defines a transaction as legal only if it obeys
user-defined integrity cons traints. Essentially, these constraints define legal database
states and proscribe transactions that cause transitions from a legal state to an illegal
state. For example, if you are making a transfer of funds from a checking account to a
savings account a nd your business rules require that such a transfer be logged to
another table, any problems updating that table will violate the integrity constraint and
will require that the entire transaction be rolled back.
Search WWH ::




Custom Search