NonStop Systems Introduction for H-Series RVUs
Transaction Management
NonStop Systems Introduction for H-Series RVUs—540083-001
5-2
What Is a TMF Transaction?
transfers $1000 from a $5000 savings account to a $50 checking account. When the
transaction ends, the customer should have $4000 in the savings account and $1050
in the checking account.
Note that if a failure occurs after the transaction has debited the savings account by
$1000 but before it has credited the checking account with $1000, the database is
inconsistent because the checking account record no longer has a correct relationship
with the savings account record. The decrease in the savings balance is not matched
by an increase in the checking balance.
This is where TMF plays an important role. It ensures that a group of update
operations is applied as one logical unit of work. Either they all happen or none of them
happen. TMF takes the concept of a transaction as a group of computer operations
and redefines it as a single unit of work that is recovered as a whole in the event of a
failure.
For example, if a failure interrupts the money-transfer transaction at the point shown in
Figure 5-1, TMF backs out the change made to the savings account record. That is, it
cancels the new savings balance by restoring the old balance. As a result, the
database looks exactly the way it looked before the transaction started. It shows $5000
in the savings account and $50 in the checking account. The database is back in a
consistent state because the savings account record and the checking account record
agree with each other.
When the transaction is redone and successfully completed, the database is in a new
consistent state, with a savings balance of $4000 and a checking balance of $1050. To
summarize, the purpose of TMF is to enable transactions to transform the database
from one consistent state to another consistent state.
Figure 5-1. Money-Transfer Transaction
Money-transfer transaction
Database records
Transaction begins
Savings balance Checking balance
Savings account debited
$1000
Checking account credited
$1000
Transaction ends
$5000
$4000
$4000
$4000
$50
$50
$1050
$1050
Failure point
VST056.vdd










