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


Starts a sub-transaction specified by its parent's name.

C Language

int lr_start_sub_transaction( char *sub_transaction, char *parent_transaction  );
Example: lr_start_sub_transaction Transaction Functions

Java Language

int lr.start_sub_transaction( String sub_transaction, String parent_transaction  );
Example: lr.start_sub_transaction and lr.end_sub_transaction Transaction Functions Java Syntax


Name Comments
sub_transaction The name of the sub-transaction
parent_transaction The name of the parent transaction in which the sub-transaction is nested.

The lr_start_sub_transaction function marks the beginning of a sub-transaction. To mark the end of the sub-transaction, use lr_end_sub_transaction. You insert these functions immediately before and after the sub-transaction actions.

Sub-transactions are used for isolating parts of a business process. For example, a sub-transaction "electrical_purchases" may be nested within the larger transaction "purchases." The transaction "purchases" is the parent transaction and "electrical_purchases" the sub-transaction.

Multiple sub-transactions can be nested within a parent transaction. A sub-transaction may also be a parent to a smaller sub–transaction.

The duration of a transaction or sub-transaction is the sum of the durations of all steps between its start and end, including the steps that are included in sub-transactions.

Each lr_start_sub_transaction statement must be matched with an lr_end_sub_transaction statement within the script or it will be interpreted as an illegal command.

Note: Do not use the period character (.) in a transaction or sub-transaction name. The period character delimits transactions and sub-transactions. In analysis, a transaction name with a period will be interpreted as two transactions.

Return Values

This function returns 0 if it succeeds. It returns -1 if the transaction name is illegal or if there is no prior call to lr_start_transaction with a transaction of the same name.


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