The MongoDB\Driver\Session class

Introduction

The MongoDB\Driver\Session class represents a client session and is returned by MongoDB\Driver\Manager::startSession. Commands, queries, and write operations may then be associated the session.

Class synopsis

MongoDB\Driver\Session
final class MongoDB\Driver\Session {
/* Constants */
const string MongoDB\Driver\Session::TRANSACTION_NONE = none;
const string MongoDB\Driver\Session::TRANSACTION_STARTING = starting;
const string MongoDB\Driver\Session::TRANSACTION_IN_PROGRESS = in_progress;
const string MongoDB\Driver\Session::TRANSACTION_COMMITTED = committed;
const string MongoDB\Driver\Session::TRANSACTION_ABORTED = aborted;
/* Methods */
final public void abortTransaction()
final public void advanceClusterTime(arrayobject $clusterTime)
final public void advanceOperationTime(MongoDB\BSON\TimestampInterface $operationTime)
final public void commitTransaction()
final private __construct()
final public void endSession()
final public objectnull getClusterTime()
final public object getLogicalSessionId()
final public MongoDB\BSON\Timestampnull getOperationTime()
final public MongoDB\Driver\Servernull getServer()
final public arraynull getTransactionOptions()
final public string getTransactionState()
final public bool isDirty()
final public bool isInTransaction()
final public void startTransaction(arraynull $options = null)
}

Predefined Constants

MongoDB\Driver\Session::TRANSACTION_NONE

There is no transaction in progress.

MongoDB\Driver\Session::TRANSACTION_STARTING

A transaction has been started, but no operation has been sent to the server.

MongoDB\Driver\Session::TRANSACTION_IN_PROGRESS

A transaction is in progress.

MongoDB\Driver\Session::TRANSACTION_COMMITTED

The transaction was committed.

MongoDB\Driver\Session::TRANSACTION_ABORTED

The transaction was aborted.

Table of Contents