Java Reference
In-Depth Information
Isolation
Isolation means that the effects of a transaction must be invisible to other
transactions until the current transaction is complete. For example, if you are making
a transfer of funds from a checking account to a savings account, the intermediate
balances after savings have been debited, but before checking has been credited,
must not be available to an outside transaction. If the intermediate balances are
available to an outside transaction, you might, for example, generate an insufficient
funds warning, since the funds will show up in neither account.
Durability
The durability requirement demands that, once committed, the results of a transaction
be preserved in some form of long term storage. In other words, once a funds transfer
has been made from savings to checking, the DBMS must save it to persistent
storage.
Transaction Management in SQL
If anything goes wrong during the transaction, the database management system
allows the entire transaction to be cancelled, or "Rolled Back." If, on the other hand, it
completes successfully, the transaction can be saved to the database, or
"Committed."
A transaction typically involves several related commands, as in the case of a bank
transfer. If a client orders a transfer of funds from his savings account to his checking
account, at least these two database-access commands must be executed:
 
The savings account must be debited.
 
The checking account must be credited.
If one of these commands is executed and the other is not, the funds will either vanish
from the savings account without appearing in the checking account, or the funds will
be credited to the checking account without being withdrawn from the savings
account.
The solution is to combine logically related commands into groups that are committed
as a single transaction. If a problem arises, the entire transaction can be rolled back,
and the problem can be fixed without serious adverse impact on business operations.
SQL supports this requirement through the COMMIT and ROLLBACK commands.
The COMMIT command commits changes made from the beginning of the
transaction to the point at which the command is issued, and the ROLLBACK
command undoes them.
Search WWH ::




Custom Search