Product Documentation

FairCom ISAM for C

Previous Topic

Next Topic

Transaction Processing Overview

There are two major aspects to transaction processing: atomicity and automatic recovery. These are related yet different aspects to transaction processing, and not all database products supply both as FairCom does. Both are discussed in detail in Data Integrity. Atomicity involves ensuring that if any elements are committed that all elements of the transaction are committed. Automatic recovery ensures that any committed updates will be made to the data and index files even in the event of a system crash.

FairCom provides a set of functions and file modes that cover both aspects of transaction processing. This allows you to specify the type of transaction processing used on a file-by-file basis in one of three modes:

  • The ctPREIMG file mode allows atomicity by caching updates to files and only changing the files when the entire transaction is complete.
  • The ctTRNLOG file mode adds automatic recovery to the ctPREIMG file mode by logging the cached updates to a transaction log file.
  • A file with neither ctPREIMG nor ctTRNLOG specified supports no transaction processing. This allows you to disable transaction processing for temporary or non-critical files to improve performance.

The transaction processing API functions work with the file modes to complete the process:

Function

Description

Begin()

Begins the transaction. All updates are tracked from this point.

Commit()

Ends the transaction and posts all updates to the files.

Abort() and AbortXtd()

Ends the transaction without posting updates to the files.

SetSavePoint()

Establishes a drop back position (savepoint) within a transaction.

RestoreSavePoint()

Drops back to the last savepoint without aborting the transaction,

For more information of transaction processing, see Data Integrity.

TOCIndex