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\RuntimeExceptionif the transaction could not be aborted (e.g. a transaction was not started).
See Also
MongoDB\Driver\Manager::startSessionMongoDB\Driver\Session::commitTransactionMongoDB\Driver\Session::startTransaction