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

MongoDB\Driver\Session::isInTransaction

PHP function Edit on GitHub ✎

(mongodb >=1.6.0)

Returns whether a multi-document transaction is in progress

Description

MongoDB\Driver\Session::isInTransaction(): bool

Returns whether a multi-document transaction is currently in progress for this session. A transaction is considered "in progress" if it has been started but has not been committed or aborted.

Parameters Parameters

Return Values

Returns true if a transaction is currently in progress for this session, and false otherwise.

Errors/Exceptions

See Also

  • MongoDB\Driver\Session::getTransactionState

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