Transaction Integrity Overview

How to:

This topic describes how WebFOCUS Maintain ensures transaction integrity at the application level. At the data source level, each database management system (DBMS) implements transaction integrity in its own way. For more information, see your DBMS vendor documentation for DBMS-specific information. For FOCUS data sources, this DBMS-specific information is presented in Ensuring Transaction Integrity for FOCUS Data Sources. For DB2, you can find some suggested strategies for writing Maintain transactions to DB2 data sources in Ensuring Transaction Integrity for DB2 Data Sources. For many other types of data sources, you can also apply the strategies described in Ensuring Transaction Integrity for DB2 Data Sources, changing DBMS-specific details when necessary.


Top of page

Example: Describing a Transfer of Funds as a Logical Transaction

A banking application would define a transfer of funds from one account to another as one logical transaction comprising two update operations:


Top of page

x
Procedure: How to Process a Logical Transaction

To process a logical transaction, follow these steps:

  1. DBMS requirements. The database management system of your data sources (DBMS) may require that you perform some tasks to enable transaction integrity. For more information, see your DBMS vendor documentation for information.

    You can set some native DBMS parameters using the SYS_MGR.FOCSET command. For more information, see the Maintain Language Reference manual. You can also set some native DBMS parameters through FOCUS. See your server documentation.

    For FOCUS data sources, you must set the COMMIT server parameter to ON, and issue a USE command to specify which FOCUS Database Server will manage concurrent access to the data source. For more information, see Ensuring Transaction Integrity for FOCUS Data Sources.

  2. Develop the transaction logic. Code the data source commands and related logic that read from the data sources, write to the data sources, and evaluate the success of each data source command.
  3. Define the transaction boundary. Code a COMMIT command, and any other supporting commands, to define the transaction boundary. For more information, see Defining a Transaction.
  4. Evaluate the success of the transaction. Test the FocCurrent transaction variable to determine if the transaction was successfully written to the data source, and then branch accordingly. For more information, see Evaluating Whether a Transaction Was Successful.

WebFOCUS