Transaction Styles

When you bracket a transaction you tell the system, "I'm starting a transaction here," (

Start
), you then put in the entire set of operations that must be atomic, and then tell the system that you're ending the transaction (
Commit
).

Transaction processing systems (discussed below) provide either explicit transaction bracketing or implicit transaction bracketing. In implicit systems, the application does not have to issue

start
or
commit
operations, because this is done automatically. In explicit transaction bracketing, the developer must include both the
start
and the
commit
operations explicitly.

There are two ways that applications can bracket transactions. One is for the program to be divided into a set of alternating regions, like black and white boxes. The white boxes would represent work done inside a transaction and the black boxes would represent work done outside of any transaction. This is known as the unchained model. In this model, the programmer would issue all

start
,
commit
, and
abort
operations, and thus the transaction bracketing is explicit.

In the alternative model, all work is done inside a transaction. When one transaction ends, another is automatically started. Thus, committing or aborting a transaction starts another transaction. This is known as the chained model, and the transaction bracketing is implicit.

The only advantage to the unchained model is that there may be some time saved if operations can be issued outside of a transaction. The chained model provides a safer environment, as all operations are transaction controlled. The overhead the chained model incurs as a result of the added cost of processing all requests from within a transaction is small in most cases.

© 1998 by Wrox Press. All rights reserved.