Loading TOC...

MarkLogic 12 EA 1 Product Documentation
xdmp.xaComplete

xdmp.xaComplete(
   forestID as (Number|String),
   txn-id as (Number|String),
   commit as Boolean,
   remember as Boolean
) as null

Summary

Completes (commits or rolls back) a prepared XA transaction.

Parameters
forestID A forest ID.
txn-id The transaction ID.
commit Whether to commit or rollback. A value of true means commit.
remember Whether to remember the completion until explicitly forgotten.

Required Privileges

http://marklogic.com/xdmp/privileges/complete-my-transactions

http://marklogic.com/xdmp/privileges/complete-any-transactions

Usage Notes

You should usually let the Transaction Manager handle commit or rollback of global transactions. This function is made available for unusual circumstances in which you need to heuristically complete the MarkLogic branch of a global XA transaction. For example, if contact with the Transaction Manager is lost for a long time.

Example

xdmp.xaComplete(forest-id, txn-id, true, true);
=> Empty. The given transaction is committed and the
   outcome is remembered.

xdmp.xaComplete(forest-id, txn-id, false, true);
=> Empty. The given transaction is rolled back and the
     outcome is remembered.

Stack Overflow iconStack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.