When a transaction block in Ballerina code begins, it will call this function to begin a transaction.
Get the current transaction id.
When a transaction block in Ballerina code begins, it will call this function to begin a transaction. If this is a new transaction (transactionId == () ), then this instance will become the initiator and will create a new transaction context. If the participant and initiator are in the same process, this transaction block will register with the local initiator via a local function call. If the participant and initiator are in different processes, this transaction block will register with the remote initiator via a network call.
- transactionId string?
Globally unique transaction ID. If this is a new transaction which is initiated, then this will be null. If this is a participant in an existing transaction, then it will have a value.
- transactionBlockId string
ID of the transaction block. Each transaction block in a process has a unique ID.
- registerAtUrl string
The URL of the initiator
- coordinationType string
Coordination type of this transaction
function getCurrentTransactionId() returns string
Get the current transaction id. This function is useful for user code to save state against a transaction ID,
so that when the
onabort functions registered for a transaction can retrieve that state using the
transaction that is passed in to those functions.
A string representing the ID of the current transaction.