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 | I Log and prepare |
setData | I Associates some data with the current transaction branch. |
setRollbackOnly | I Prevents the global transaction from committing successfully. |
getData
function getData() returns readonly
Retrieves data associated with the current transaction branch.
The data is set using setData
.
Return Type
(readonly)the data, or ()
if no data has been set.
getInfo
function getInfo(byte[ ] xid) returns Info?
Returns information about the transaction with the specified xid.
Parameters
- xid byte[ ]
transaction id
getRollbackOnly
function getRollbackOnly() returns boolean
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
Returns information about the current transaction.
onCommit
function onCommit(CommitHandler handler)
Adds a handler to be called if and when the global transaction commits.
Parameters
- handler CommitHandler
the function to be called on commit
onRollback
function onRollback(RollbackHandler handler)
Adds a handler to be called if and when the global transaction rolls back.
Parameters
- handler RollbackHandler
the function to be called on rollback
prepareError
Log and prepare error
as a Error
.
setData
function setData(readonly data)
Associates some data with the current transaction branch.
Parameters
- data readonly
Data to be set
setRollbackOnly
function setRollbackOnly(error? e)
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
- e error?
the error that caused the rollback or ()
, if there is none