March 2002
Intermediate to advanced
464 pages
8h 51m
English
Business transactions are frequently carried out in a series of separate steps. Consider the following example where a customer purchases an airline ticket online. Here we use pseudocode that shows the required steps in a transactional environment.
try {
startTransaction();
reserveFlight();
payForFlight();
commitTransaction();
} catch (Exception ex) {
rollbackTransaction();
}
For this transaction to complete, all steps must be successful. Otherwise, data may be inconsistent. These separate steps make up a transaction context, which is viewed as a single operation.
A transaction that commits means that all steps in the transaction were successful and data is saved. A transaction that rolls back means that one or more ...
Read now
Unlock full access