<?xml version="1.0" encoding="UTF-8"?><api:function-page xml:base="/apidoc/8.0/xdmp.transactionCommit.xml" generated="2015-10-07T16:36:00.016766-07:00" mode="javascript" xmlns:api="http://marklogic.com/rundmc/api"><api:function-name>xdmp.transactionCommit</api:function-name><api:suggest>xdmp.transactioncommit</api:suggest><api:suggest>xdmp</api:suggest><api:suggest>transactioncommit</api:suggest><api:function-link mode="xquery" fullname="xdmp:transaction-commit">/apidoc/8.0/xdmp:transaction-commit.xml</api:function-link><api:function mode="javascript" name="transactionCommit" type="builtin" lib="xdmp" category="TransactionBuiltins" hidden="false" bucket="MarkLogic Built-In Functions" prefix="xdmp" namespace="http://marklogic.com/xdmp" fullname="xdmp.transactionCommit"><api:summary>
  Explicitly commit a transaction running on a named host.
</api:summary><api:params><api:param name="host-id" type="xs:unsignedLong"><api:param-description>
    A host id.
  </api:param-description><api:param-name>host-id</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: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">
     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.
  </p>
  <p xmlns="http://www.w3.org/1999/xhtml">
     When you call <code>xdmp:transaction-commit</code>, 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
     <a href="./xdmp:host-status"><code>xdmp:host-status</code></a>.
  </p>
  <p xmlns="http://www.w3.org/1999/xhtml">
     If the named host or transaction does not exist, an error is raised.
  </p>
</api:usage><api:example class="javascript"><pre xml:space="preserve" xmlns="http://www.w3.org/1999/xhtml">
xdmp.transactionCommit(xdmp.host("some-host.yourdomain.com"), some-txn-id);

=&gt; Empty. The given transaction is marked ready to be committed.
</pre></api:example></api:function></api:function-page>