Explicit Transaction Usage Cases
To include multiple local transactions in a single flow, you must explicitly start and end each transaction except the first one.
Depending on what the flow needs to accomplish, you may explicitly start and end XAResource transactions as well. This way, you can create a flow that includes multiple local transactions and multiple XAResource transactions.
For example, the following flow includes a local transaction nested within another local transaction:
BEGIN FLOW // start transaction 1
.
.
.
INVOKE startTransaction(2) // start transaction 2
.
.
.
INVOKE commitTransaction(2) // commit transaction 2
END FLOW // commit transaction 1
A nested transaction must adhere to the same rules that apply to container-manager transactions. That is, a nested transaction can contain one of the following:
One local transaction, interacting with one resource
One or more XAResource transactions, where each transaction can interact with one or more resources
One or more XAResource transactions and one local transaction
Following are some examples of explicit transactions.