Loading TOC...

xdmp.transactionCommit

xdmp.transactionCommit(
   host-id as (Number|String),
   txn-id as (Number|String)
) as null

Summary

Explicitly commit a transaction running on a named host.

Parameters
host-id A host id.
txn-id The transaction ID.

Required Privileges

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

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

Usage Notes

Use this function to explicitly commit a remote transaction running in "update" or "query" transaction mode. You typically will not use this function for transactions running in "auto" transaction mode because the server commits such transactions automatically, at the end of every statement.

When you call xdmp.transactionCommit, the transaction is marked for commit. The commit occurs asyncronously at a point in time after the end of the current executing statement, typically after the next cluster heartbeat. The transaction ends at that point, and you can verify it with xdmp.hostStatus.

If the named host or transaction does not exist, an error is raised.

See Also

Example

xdmp.transactionCommit(xdmp.host("some-host.yourdomain.com"), some-txn-id);

=> Empty. The given transaction is marked ready to be committed.

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