ballerina/transactions package
Type Definitions
Type |
|
Values |
Description |
TransactionState |
|
prepared | committed | active | aborted |
|
Records Summary
Objects Summary
Endpoints Summary
Functions Summary
Global Variables
public type Anonymous Record 0
Field Name |
Data Type |
Default Value |
Description |
count |
int |
|
|
interval |
int |
|
|
public type Anonymous Record 1
Field Name |
Data Type |
Default Value |
Description |
count |
int |
|
|
interval |
int |
|
|
public type NotifyRequest
Field Name |
Data Type |
Default Value |
Description |
transactionId |
string |
|
|
message |
string |
|
|
public type NotifyResponse
Field Name |
Data Type |
Default Value |
Description |
message |
string |
|
|
public type Participant2pcClientConfig
public type PrepareRequest
Field Name |
Data Type |
Default Value |
Description |
transactionId |
string |
|
|
public type PrepareResponse
Field Name |
Data Type |
Default Value |
Description |
message |
string |
|
|
public type RemoteProtocol
This represents the protocol associated with the coordination type.
Field Name |
Data Type |
Default Value |
Description |
name |
string |
|
|
url |
string |
|
- protocol URL. This URL will have a value only if the participant is remote. If the participant is local,
the
protocolFn will be called
|
public type RequestError
Field Name |
Data Type |
Default Value |
Description |
errorMessage |
string |
|
|
public type TransactionContext
Field Name |
Data Type |
Default Value |
Description |
contextVersion |
string |
1.0 |
|
transactionId |
string |
|
|
transactionBlockId |
int |
|
|
coordinationType |
string |
|
|
registerAtURL |
string |
|
|
public 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 oncommit
or onabort
functions registered for a transaction can retrieve that state using the
transaction that is passed in to those functions.
|
Return Type |
|
Description |
|
string |
|
|
public function registerParticipantWithRemoteInitiator(string transactionId, int transactionBlockId, string registerAtURL, transactions:0.0.0:RemoteProtocol[] participantProtocols) returns (TransactionContext | error)
Registers a participant with the initiator's coordinator. This function will be called by the participant
Parameter Name |
Data Type |
Default Value |
Description |
transactionId |
string |
|
- ID of the transaction to which this participant is registering with
|
transactionBlockId |
int |
|
- The local ID of the transaction block on the participant
|
registerAtURL |
string |
|
- The URL of the initiator to which this participant will register with
|
participantProtocols |
transactions:0.0.0:RemoteProtocol[] |
|
|
public type Participant2pcClient object
-
<Participant2pcClient>
prepare(string transactionId) returns (string | error)
Parameter Name |
Data Type |
Default Value |
Description |
transactionId |
string |
|
|
-
<Participant2pcClient>
notify(string transactionId, string message) returns (string | error)
Parameter Name |
Data Type |
Default Value |
Description |
transactionId |
string |
|
|
message |
string |
|
|
Endpoint Participant2pcClientEP
-
<Participant2pcClientEP>
prepare(string transactionId) returns (string|error)
Parameter Name |
Data Type |
Default Value |
Description |
transactionId |
string |
|
|
-
<Participant2pcClientEP>
notify(string transactionId, string message) returns (string|error)
Parameter Name |
Data Type |
Default Value |
Description |
transactionId |
string |
|
|
message |
string |
|
|