Utility Functions and C Language Reference > Utility Functions: Java (lr.) > Alphabetical Listing > lr_stop_transaction


Freezes reporting of transaction data.

C Language

double lr_stop_transaction( char *transaction_name  );
Example: lr_stop_transaction and lr_resume_transaction Transaction Functions

Java Language

Double lr.stop_transaction( String transaction_name  );
Example: lr_stop_transaction and lr_resume_transaction Transaction Functions Java Syntax


Name Comments
transaction_name The name of an open transaction.

This function is retained for backward compatibility. For more general ways of reporting partial transaction durations, see lr_start_sub_transaction and lr_set_transaction.

After a call to lr_stop_transaction, statistics returned by the "get" Transaction Functions reflect only the data up to the call, until lr_resume_transaction is called. The specified transaction must have been opened with lr_start_transaction.

Data collection, however, is not interrupted. After the call to lr_resume_transaction, the "get" functions return all data since the start of the transaction. Furthermore, the final results when the test is analyzed will reflect the total values, including the periods in between the transaction stop and resume.

If lr_resume_transaction is not called, the "get" functions and the final results reflect only the duration from the transaction start to the lr_stop_transaction call. Thus, lr_stop_transaction and lr_resume_transaction can be used conditionally to collect information either about an entire transaction, or only the beginning. To accomplish this, call lr_resume_transaction only if your condition is met.

Note: When data is collected this way, the data in analysis will reflect both the tests where the condition for lr_resume_transaction is met, and the tests where it is not.

If the section you may wish to exclude ends before the end of the transaction, this technique does not apply. If you need to differentiate between occurrences where the lr_resume_transaction condition is met and those where it is not in the analysis data, this technique does not apply.

Return Values

This function returns the duration of the current transaction in milliseconds, or a negative number on error.


All string arguments (char type) can be parameterized using standard parameterization.