php8.5
Home/ Manual/ driver / session/ MongoDB\Driver\Session::abortTransaction

MongoDB\Driver\Session::abortTransaction

PHP function Edit on GitHub ✎

(mongodb >=1.5.0)

Aborts a transaction

Description

MongoDB\Driver\Session::abortTransaction(): void

Terminates the multi-document transaction and rolls back any data changes made by the operations within the transaction. That is, the transaction ends without saving any of the changes made by the operations in the transaction.

Parameters Parameters

Return Values

Void

Errors/Exceptions

  • Throws MongoDB\Driver\Exception\RuntimeException if the transaction could not be aborted (e.g. a transaction was not started).

See Also

  • MongoDB\Driver\Manager::startSession
  • MongoDB\Driver\Session::commitTransaction
  • MongoDB\Driver\Session::startTransaction

Source: reference/mongodb/mongodb/driver/session/aborttransaction.xml · from the official PHP manual (php/doc-en)