HPlogo Getting Started as an MPE/iX Programmer Programmer's Guide: HP 3000 Computer MPE/iX Computer Systems > Chapter 1 OVERVIEW

MPE/iX Transaction Management Facility

» 

Technical documentation

Complete book in PDF
» Feedback

 » Table of Contents

 » Index

The MPE/iX Transaction Management Facility provides the following functions for transaction-oriented applications:

  • Automatic transaction locking

  • Automatic transaction logging

  • Automatic rollback recovery from "soft" failures

  • Semi-automatic rollforward recovery from "hard" failures

These functions are described in detail in the subsections below.

Transaction Locking

A transaction is a series of data updates that must be entirely completed to obtain logical consistency; either all or none of the updates in the series must be done. To the user, a transaction may appear to be a single change. However, internal to the system, it may require many changes to records in several files or data sets.

For example, if you enter a customer order on the system with a simple command, it may internally require updating several files containing data on orders, customers, and inventory requirements. The multiple changes, all of which are required for logical consistency, form one transaction.

The MPE/iX Transaction Management Facility ensures data consistency and integrity by providing automatic transaction locking. Transaction locking meets two criteria:

  • Only one transaction at a time is allowed to update a given portion of data.

  • All changes that are part of a transaction must be completed before the changes are committed to disc (permanently recorded). When a transaction is abnormally terminated before it is completed, the changes made up to that point are not committed.

MPE/iX transaction locking is based on page-level protection of the system architecture and does not require significant CPU overhead.

Transaction Logging and Recovery

The Transaction Management Facility automatically generates and maintains a transaction log file that records all transaction updates. Maintaining a log file facilitates recovery from the abnormal end of transactions and system failures. In these cases, files can be restored to a consistent state by copying the contents of the log file into the data file. This "undoes" the actions of partially committed transactions.

System failures are either hard or soft. When a soft failure occurs, data is not altered or lost, but some incomplete transactions may exist. In this case, the Recovery Manager portion of the Transaction Management Facility is automatically invoked to perform recovery of the data file when the system is restarted. Files are restored to their original state by copying the "before image" of data from the log file for incomplete transactions. This is called rollback recovery. Recovery from a soft failure is efficient and takes a maximum of only a few minutes. Rollback recovery is automatically performed for abnormally ended transactions.

When a hard failure occurs (for example, a disc media failure), data is lost. At system restart, you must mount a backup tape and issue the MPE/iX command :RECOVER. The Transaction Management Facility returns data to a consistent state by reapplying all committed transactions in the log file to the checkpoint presented by the backup tape. This is called "rollforward recovery."

Transaction logging requires little CPU overhead because it is designed as an integral part of the MPE/iX File System, utilizing the addressing and protection features of HP Precision Architecture (HP-PA).

Simplifying a Program

The Transaction Management Facility simplifies development and maintenance of transaction-oriented applications by:

  • Maintaining recovery routines, so a programmer does not have to develop and maintain custom ones.

  • Simplifying the programming task of ensuring data integrity and increasing its efficiency.

  • Providing locking and logging, thus requiring the programmer to mark only the beginning and end of transactions.

Feedback to webmaster