start_xact

Description

Start a distributed transaction using the commit service.

Syntax

DBINT start_xact(connect, application_name, xact_name,
               site_count)
 
DBPROCESS     *connect;
char                    *application_name;
char                    *xact_name;
int                         site_count;

Parameters

connect

A pointer to the DBPROCESS used to communicate with the commit service.

application_name

The name of the application. The application developer can choose any name for the application. It will appear in the table maintained by the commit service but is not used by the commit service or the Adaptive Server recovery system.

xact_name

The name of the transaction. This name will appear in the table maintained by the commit service and must be supplied as part of the transaction name string built by build_xact_string. The name cannot contain a period (.) or a colon (:).

site_count

The number of sites participating in the transaction.

Returns

An integer called the commid. This number is used to identify the transaction in subsequent calls to the commit service. In case of error, this routine will return 0.

Usage

This routine records the start of a distributed transaction with the commit service. A record is placed in the commit service containing the commid, which is a number that caller subsequently uses to identify the transaction to the commit service.

See also

abort_xact, build_xact_string, commit_xact, remove_xact, scan_xact, stat_xact