Functions

getData
I

Retrieves data associated with the current transaction branch.

getInfo
I

Returns information about the transaction with the specified xid.

getRollbackOnly
I

Tells whether it is known that the transaction will be rolled back.

info
I

Returns information about the current transaction.

onCommit
I

Adds a handler to be called if and when the global transaction commits.

onRollback
I

Adds a handler to be called if and when the global transaction rolls back.

prepareError

Log and prepare error as a Error.

setData
I

Associates some data with the current transaction branch.

setRollbackOnly
I

Prevents the global transaction from committing successfully.

getData

function getData() returns (any | error) & readonly
Isolated Function

Retrieves data associated with the current transaction branch.

The data is set using setData.

Return Type

((any | error) & readonly)

the data, or () if no data has been set.

getInfo

function getInfo(byte[ ] xid) returns Info?
Isolated Function

Returns information about the transaction with the specified xid.

Parameters

  • xid byte[ ]
  • transaction id

Return Type

(Info?)

information about the transaction

getRollbackOnly

function getRollbackOnly() returns boolean
Isolated Function

Tells whether it is known that the transaction will be rolled back.

Return Type

(boolean)

true if it is known that the transaction manager will, when it makes the decision whether to commit or rollback, decide to rollback

info

function info() returns Info
Isolated Function

Returns information about the current transaction.

Return Type

(Info)

information about the current transaction

onCommit

function onCommit(CommitHandler handler)
Isolated Function

Adds a handler to be called if and when the global transaction commits.

Parameters

onRollback

function onRollback(RollbackHandler handler)
Isolated Function

Adds a handler to be called if and when the global transaction rolls back.

Parameters

prepareError

function prepareError(string message, error? err) returns Error

Log and prepare error as a Error.

Parameters

  • err error? (default ())
  • error instance

Return Type

(Error)

Prepared Error instance

setData

function setData((any | error) & readonly e)
Isolated Function

Associates some data with the current transaction branch.

Parameters

  • e (any | error) & readonly
  • Data to be set

setRollbackOnly

function setRollbackOnly(error? e)
Isolated Function

Prevents the global transaction from committing successfully.

This ask the transaction manager that when it makes the decision whether to commit or rollback, it should decide to rollback.

Parameters