Transactions
Byenclosing one or more steps in an indivisible unit of work, a transaction ensures data
integrityand consistency. This chapter contains the following sections:
“AboutTransactions” on page 143
“AdminConsole Tasks for Transactions” on page 145

AboutTransactions

“Whatis a Transaction?” on page 143
“Transactionsin Java EE Technology” on page 144
“Workaroundsfor Specic Databases” on page 145

Whatis a Transaction?

Atransaction is a series of discreet actions in an application that must all complete successfully
orelse all the changes in each action are backed out. For example, to transfer funds from a
checkingaccount to a savings account is a transaction with the following steps:
1. Checkto see if the checking account has enough money to cover the transfer.
2. Ifthere’s enough money in the checking account debit the amount from the checking
account.
3. Creditthe money to the savings account.
4. Recordthe transfer to the checking account log.
5. Recordthe transfer to the savings account log.
Ifany of these steps fails, all changes from the preceding steps must be backed out, and the
checkingaccount and savings account must be in the same state as they were before the
transactionstarted. This event is called a rollback. If all the steps complete successfully, the
transactionis in a committed state. Transactions end in either a commit or a rollback.
12
CHAPTER 12
143