User's Guide
Reference Manual
Release Notes
PDF
Top

cosTransactions
Reference Manual
Version 1.3

Expand All
Contract All

Table of Contents

- cosTransactions
  - Top of manual page
  - start/0
  - stop/0
  - start_factory/0
  - start_factory/1
  - stop_factory/1
- CosTransactions_Control
  - Top of manual page
  - get_coordinator/1
  - get_terminator/1
- CosTransactions_Coordinator
  - Top of manual page
  - create_subtransaction/1
  - get_transaction_name/1
  - get_parent_status/1
  - get_status/1
  - get_top_level_status/1
  - hash_top_level_tran/1
  - hash_transaction/1
  - is_descendant_transaction/2
  - is_same_transaction/2
  - is_top_level_transaction/1
  - register_resource/2
  - register_subtran_aware/2
  - rollback_only/1
- CosTransactions_RecoveryCoordinator
  - Top of manual page
  - replay_completion/3
- CosTransactions_Resource
  - Top of manual page
  - commit/1
  - commit_one_phase/1
  - forget/1
  - prepare/1
  - rollback/1
- CosTransactions_SubtransactionAwareResource
  - Top of manual page
  - commit_subtransaction/2
  - rollback_subtransaction/1
- CosTransactions_Terminator
  - Top of manual page
  - commit/2
  - rollback/1
- CosTransactions_TransactionFactory
  - Top of manual page
  - create/2

# cosTransactions

### MODULE

cosTransactions

### MODULE SUMMARY

The main module of the cosTransactions application.

### DESCRIPTION

To get access to the record definitions for the structures use:
-include_lib("cosTransactions/include/CosTransactions.hrl").

This module contains the functions for starting and stopping the application. If the application is started using application:start(cosTransactions) the default configuration is used (see listing below). The Factory reference is stored using the CosNaming Service under the id "oe_cosTransactionsFac_IPNo".

The following application configuration parameters exist:

- maxRetries - default is 40 times, i.e., if a transaction participant is unreachable the application will retry to contact it N times. Reaching the maximum is considered to be a disaster.
- comFailWait - default is 5000 milliseconds, i.e., before the application retries to contact unreachable transaction participants the application wait Time milliseconds.

### EXPORTS

start() -> Return

Types:

Return = ok | {error, Reason}

This operation starts the cosTransactions application.

stop() -> Return

Types:

Return = ok | {error, Reason}

This operation stops the cosTransactions application.

start_factory() -> TransactionFactory

Types:

TransactionFactory = #objref

This operation creates a Transaction Factory. The Factory is used to create a new top-level transaction using default options (see listing below).

start_factory(FacDef) -> TransactionFactory

Types:

FacDef = [Options], see Option listing below.
TransactionFactory = #objref

This operation creates a Transaction Factory. The Factory is used to create a new top-level transaction.

The FacDef list must be a list of {Item, Value} tuples, where the following values are allowed:

- {hash_max, HashValue} - This value denotes the upper bound of the hash value the Coordinator uses. Default is 1013. HashValue must be an integer.
- {allow_subtr, Boolean} - If set to true it is possible to create subtransactions. Default is true.
- {typecheck, Boolean} - If set to to true all transaction operation's arguments will be type-checked. Default is true.
- {tty, Boolean} - Enables or disables error printouts to the tty. If Flag is false, all text that the error logger would have sent to the terminal is discarded. If Flag is true, error messages are sent to the terminal screen.
- {logfile, FileName} - This function makes it possible to store all system information in FileName (string()). It can be used in combination with the tty(false) item in to have a silent system, where all system information are logged to a file. As default no logfile is used.
- {maxRetries, Integer} - default is 40 times, i.e., if a transaction participant is unreachable the application will retry to contact it N times. Reaching the maximum is considered to be a disaster. This option overrides the application configuration parameter.
- {comFailWait, Integer} - default is 5000 milliseconds, i.e., before the application retries to contact unreachable transaction participants the application wait Time milliseconds. This option overrides the application configuration parameter.

stop_factory(TransactionFactory) -> Reply

Types:

TransactionFactory = #objref
Reply = ok | {'EXCEPTION', E}

This operation stop the target transaction factory.