start_xact

Starts a distributed transaction using the commit service.

Syntax

DBINT start_xact (
PDBPROCESS
connect,
LPCSTR
application_name,
LPCSTR
xact_name,
INT
site_count );

where

connect
Is the DBPROCESS structure used to communicate with the commit service.
application_name
Is the name of the application. This name can be anything you choose. It appears in the table maintained by the commit service but is not used by the commit service or the SQL Server recovery system.
xact_name
Is the name of the transaction. This name appears 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 (.) nor a colon (:).
site_count
Is the number of sites participating in the transaction.

Returns

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

Remarks

This function 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 the 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