<?xml version="1.0" encoding="UTF-8"?><api:function-page xml:base="/apidoc/8.0/xdmp.xaComplete.xml" generated="2015-10-07T16:36:00.016766-07:00" mode="javascript" xmlns:api="http://marklogic.com/rundmc/api"><api:function-name>xdmp.xaComplete</api:function-name><api:suggest>xdmp.xacomplete</api:suggest><api:suggest>xdmp</api:suggest><api:suggest>xacomplete</api:suggest><api:function-link mode="xquery" fullname="xdmp:xa-complete">/apidoc/8.0/xdmp:xa-complete.xml</api:function-link><api:function mode="javascript" name="xaComplete" type="builtin" lib="xdmp" category="TransactionBuiltins" hidden="false" bucket="MarkLogic Built-In Functions" prefix="xdmp" namespace="http://marklogic.com/xdmp" fullname="xdmp.xaComplete"><api:summary>
  Completes (commits or rolls back) a prepared XA transaction.
</api:summary><api:params><api:param name="forestID" type="xs:unsignedLong"><api:param-description>
    A forest ID.
  </api:param-description><api:param-name>forestID</api:param-name><api:param-type>String</api:param-type></api:param><api:param name="txn-id" type="xs:unsignedLong"><api:param-description>
    The transaction ID.
  </api:param-description><api:param-name>txn-id</api:param-name><api:param-type>String</api:param-type></api:param><api:param name="commit" type="xs:boolean"><api:param-description>
    Whether to commit or rollback. A value of true means commit.
  </api:param-description><api:param-name>commit</api:param-name><api:param-type>Boolean</api:param-type></api:param><api:param name="remember" type="xs:boolean"><api:param-description>
    Whether to remember the completion until explicitly forgotten.
  </api:param-description><api:param-name>remember</api:param-name><api:param-type>Boolean</api:param-type></api:param></api:params><api:return>null</api:return><api:privilege>
  <p xmlns="http://www.w3.org/1999/xhtml"><code>http://marklogic.com/xdmp/privileges/complete-my-transactions</code></p>
  <p xmlns="http://www.w3.org/1999/xhtml"><code>http://marklogic.com/xdmp/privileges/complete-any-transactions</code></p>
</api:privilege><api:usage>
  <p xmlns="http://www.w3.org/1999/xhtml">
    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.
  </p>
</api:usage><api:example class="javascript"><pre xml:space="preserve" xmlns="http://www.w3.org/1999/xhtml">
xdmp.xaComplete(forest-id, txn-id, true, true);
=&gt; Empty. The given transaction is committed and the
   outcome is remembered.

xdmp.xaComplete(forest-id, txn-id, false, true);
=&gt; Empty. The given transaction is rolled back and the
     outcome is remembered.
</pre></api:example></api:function></api:function-page>