Sophie

Sophie

distrib > Mageia > 7 > armv7hl > by-pkgid > 2b917e0437961edec048f1d15e2d7449 > files > 10204

php-manual-en-7.2.11-1.mga7.noarch.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Commits a transaction</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="mongodb-driver-session.advanceoperationtime.html">MongoDB\Driver\Session::advanceOperationTime</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="mongodb-driver-session.construct.html">MongoDB\Driver\Session::__construct</a></div>
 <div class="up"><a href="class.mongodb-driver-session.html">MongoDB\Driver\Session</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="mongodb-driver-session.committransaction" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">MongoDB\Driver\Session::commitTransaction</h1>
  <p class="verinfo">(mongodb &gt;=1.5.0)</p><p class="refpurpose"><span class="refname">MongoDB\Driver\Session::commitTransaction</span> &mdash; <span class="dc-title">Commits a transaction</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-mongodb-driver-session.committransaction-description">
  <h3 class="title">Description</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">final</span> <span class="modifier">public</span> <span class="type"><span class="type void">void</span></span> <span class="methodname"><strong>MongoDB\Driver\Session::commitTransaction</strong></span>
    ( <span class="methodparam">void</span>
   )</div>

  <p class="para rdfs-comment">
   This method commits an existing transaction and all the associated
   operations are persisted in the database.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-mongodb-driver-session.committransaction-parameters">
  <h3 class="title">Parameters</h3>
  <p class="para">This function has no parameters.</p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-mongodb-driver-session.committransaction-returnvalues">
  <h3 class="title">Return Values</h3>
  <p class="para">
   No value is returned.
  </p>
 </div>


 <div class="refsect1 errors" id="refsect1-mongodb-driver-session.committransaction-errors">
  <h3 class="title">Errors/Exceptions</h3>
  <ul class="simplelist">
   <li class="member">Throws <a href="class.mongodb-driver-exception-invalidargumentexception.html" class="classname">MongoDB\Driver\Exception\InvalidArgumentException</a> on argument parsing errors.</li>
   <li class="member">Throws
   <a href="class.mongodb-driver-exception-commandexception.html" class="classname">MongoDB\Driver\Exception\CommandException</a> if the
   server could not commit the transaction (e.g. due to conflicts, network
   issues). In case the exception&#039;s
   <span class="methodname"><a href="mongodb-driver-commandexception.getresultdocument.html" class="methodname">MongoDB\Driver\Exception\CommandException::getResultDocument()</a></span>
   has a <em>&quot;errorLabels&quot;</em> element, and this array contains a
   <em>&quot;TransientTransactionError&quot;</em> or
   <em>&quot;UnUnknownTransactionCommitResult&quot;</em> value, it is safe to re-try
   the <em class="emphasis">whole</em> transaction. In newer versions of the
   driver,
   <span class="methodname"><a href="mongodb-driver-runtimeexception.haserrorlabel.html" class="methodname">MongoDB\Driver\Exception\RuntimeException::hasErrorLabel()</a></span>
   should be used to test for this situation instead.</li>
   <li class="member">Throws
   <a href="class.mongodb-driver-exception-runtimeexception.html" class="classname">MongoDB\Driver\Exception\RuntimeException</a> if the
   transaction could not be commited (e.g. a transaction was not
   started).</li>
  </ul>
 </div>


 <div class="refsect1 seealso" id="refsect1-mongodb-driver-session.committransaction-seealso">
  <h3 class="title">See Also</h3>
  <ul class="simplelist">
   <li class="member"><span class="methodname"><a href="mongodb-driver-manager.startsession.html" class="methodname" rel="rdfs-seeAlso">MongoDB\Driver\Manager::startSession()</a> - Start a new client session for use with this client</span></li>
   <li class="member"><span class="methodname"><a href="mongodb-driver-session.aborttransaction.html" class="methodname" rel="rdfs-seeAlso">MongoDB\Driver\Session::abortTransaction()</a> - Aborts a transaction</span></li>
   <li class="member"><span class="methodname"><a href="mongodb-driver-session.starttransaction.html" class="methodname" rel="rdfs-seeAlso">MongoDB\Driver\Session::startTransaction()</a> - Starts a transaction</span></li>
   <li class="member"><span class="methodname"><a href="mongodb-driver-runtimeexception.haserrorlabel.html" class="methodname" rel="rdfs-seeAlso">MongoDB\Driver\Exception\RuntimeException::hasErrorLabel()</a> - Returns whether an error label is associated with an exception</span></li>
  </ul>
 </div>


</div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="mongodb-driver-session.advanceoperationtime.html">MongoDB\Driver\Session::advanceOperationTime</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="mongodb-driver-session.construct.html">MongoDB\Driver\Session::__construct</a></div>
 <div class="up"><a href="class.mongodb-driver-session.html">MongoDB\Driver\Session</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>