Build a name for a distributed transaction.
void build_xact_string(xact_name, service_name, commid, result) char *xact_name; char *service_name; DBINT commid; char * result;
The application or user name for the transaction. This name gets encoded in the name string but is not used by the commit service or Adaptive Server Enterprise. It serves to identify the transaction for debugging purposes.
The name that will be used by Adaptive Server Enterprise to contact the commit service, should it be necessary to recover the transaction. If service_name is NULL, the name DSCOMMIT is used.
service_name must correspond to name of the interfaces file entry for the commit service. If service_name is NULL, the interfaces file must contain an entry for DSCOMMIT.
The number used by the commit service to identify the transaction. commid is the number returned by the call to start_xact.
Address of buffer where the string should be built. The space must be allocated by the caller.
None.
This routine builds a name string for use in the SQL begin transaction and prepare transaction of an Adaptive Server Enterprise transaction. If Adaptive Server Enterprise has to recover the transaction, it uses information encoded in the name to determine which commit service to contact and which transaction in that service to inquire about. The application should issue a SQL begin transaction using the string built by build_xact_string.
The string built by build_xact_string must be large enough to hold the ASCII representation of commid, xact_name, service_name, two additional characters, and a null terminator.