When you bracket a transaction you tell the system, "I'm starting a transaction here," (
), you then put in the entire set of operations that must be atomic, and then tell the system that you're ending the transaction (Start
).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
or start
operations, because this is done automatically. In explicit transaction bracketing, the developer must include both the commit
and the start
operations explicitly.commit
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
, and commit
operations, and thus the transaction bracketing is explicit.abort
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.