Table of Contents

Class CoreSession

Namespace
MongoDB.Driver.Core.Bindings
Assembly
MongoDB.Driver.Core.dll

Represents a session.

public sealed class CoreSession : ICoreSession, IDisposable
Inheritance
CoreSession
Implements
Inherited Members

Constructors

CoreSession(ICluster, ICoreServerSession, CoreSessionOptions)

Initializes a new instance of the CoreSession class.

Properties

Cluster

Gets the cluster.

ClusterTime

Gets the cluster time.

CurrentTransaction

Gets the current transaction.

Id

Gets the session Id.

IsCausallyConsistent

Gets a value indicate whether this instance is causally consistent.

IsDirty

Gets a value indicate whether this session is dirty.

IsImplicit

Gets a value indicating whether this instance is implicit session.

IsInTransaction

Gets a value indicating whether this instance is in a transaction.

IsSnapshot

Gets a value indicate whether this instance is a snapshot session.

OperationTime

Gets the operation time.

Options

Gets the session options.

ServerSession

Gets the server session.

SnapshotTime

Gets the snapshot time.

Methods

AbortTransaction(CancellationToken)

Aborts the transaction.

AbortTransactionAsync(CancellationToken)

Aborts the transaction.

AboutToSendCommand()

The driver is about to send a command on this session. Called to track session state.

AdvanceClusterTime(BsonDocument)

Advances the cluster time.

AdvanceOperationTime(BsonTimestamp)

Advances the operation time.

AdvanceTransactionNumber()

Advances the transaction id.

CommitTransaction(CancellationToken)

Commits the transaction.

CommitTransactionAsync(CancellationToken)

Commits the transaction.

Dispose()
MarkDirty()

Marks the session as dirty.

SetSnapshotTimeIfNeeded(BsonTimestamp)

Sets the snapshot time if not set.

StartTransaction(TransactionOptions)

Starts a transaction.

WasUsed()

Called by the driver when the session is used (i.e. sent to the server).

See Also