Beginning a Transaction
Use the
awBeginTransaction method to begin the transaction. This function publishes an
Adapter::beginTransaction event, so your
Broker client must have permission to publish this event. The function requires the following parameters:
The transaction ID.
The desired transaction level.
A list of client identifiers for all the
Broker clients that are allowed to interact with events in the transaction. This list can be
NULL if you want all subscribers to participate in the transaction.
An area where a tag field can be returned. If your
Broker client does not wish to receive an acknowledgment event for the
Adapter::beginTransaction event that is to about be published, this parameter should set to
NULL.
Example of invoking the awBeginTransaction function
BrokerClient c;
BrokerError err;
char **transId;
int transTag;
. . .
// Obtain a transaction id.
. . .
// Begin the transaction
err = awBeginTransaction( c, transId, AW_TRANSACTION_LEVEL_BASIC,
0, NULL, &transTag);
if (err != AW_NO_ERROR) {
printf("Error beginning transaction\n%s\n",
awErrorToString(err));
return 0;
}
. . .