NonStop Systems Introduction
Transaction Management
NonStop Systems Introduction—527825-001
5-9
Transaction Backout
In this example, the transaction logic is similar to the order-entry transaction shown 
earlier, but there are a few changes:
•
First, assume that the step in which the transaction reads stock records to verify 
sufficient quantity for the order is no longer included in the transaction. You omit it 
because there is heavy inquiry activity from other applications, and you want to 
avoid locking the stock records until it is absolutely necessary.
•
Second, assume that the step in which the transaction checks the reorder point 
and conditionally writes a purchase order to a database at headquarters has been 
replaced by a step in which the transaction updates an accounts-receivable record 
in another database at headquarters.
As Figure 5-5 shows, this transaction has updated the databases at the sales office 
and at headquarters but finds that it cannot complete the update to the database at the 
warehouse because of a stock shortage. So the program requests TMF to undo all of 
the updates performed so far in this transaction.
TMF responds by going to its audit trail, locating the audit trail information for the 
transaction (the before-images and after-images of the records changed by the 
transaction), and applying the before-images of each record to the database.
For example, the before-image of the new sales-order record in the sales-order 
database is a blank record, because no record existed before the transaction began. 
In effect, TMF replaces the new sales-order record with a set of blanks and so 
removes the record from the database. The sales-order database now looks exactly 
the way it did before the transaction began.
Figure 5-5. Transaction Backout
Sales Office
Headquarters
Warehouse
Mirrored audit trail
Databases
Before After
Recover volumes.
Report shortage.
Log additional orders
until stock replenished.
Begin
Stock shortage
End Transaction
Unlocked
Unlocked
Unlocked
VST060.vsd










