lr.set_transaction_status
Sets the default end status of open transactions.
int lr.set_transaction_status( int status);
| Transaction Functions | Java Syntax |
Arguments
| Name | Comments |
|---|---|
| status | One of the Transaction Status constants for pass, fail, or stop. The auto status is not applicable. |
The lr.set_transaction_status function sets the status of those transactions currently open which have lr.AUTO in their lr.end_transaction statement.
A transaction's status is defined in the status parameter of lr.end_transaction. If this status is lr.AUTO, the value is automatically assigned. By default, this value is lr.PASS, signifying a successful transaction. lr.set_transaction_status changes this default value to status.
Return Values
This function returns 0 on success and a negative value on failure.
Parameterization
Parameterization is not applicable to this function.
Example
In the following example, the status of transaction t1 is changed to a fail status because a general error has occurred. Note that the exit status of transaction t2 which is not defined as LR_AUTO is unaffected by the call to lr.set_transaction_status and it remains as LR_PASS.
if (event == GENERAL_ERROR)
lr.set_transaction_status(lr,FAIL);
lr.end_transaction("t1", lr.AUTO);
lr.end_transaction("t2", lr.PASS);

