Table of Contents

Class NoCoreSession

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

An object that represents no core session.

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

Properties

ClusterTime

Gets the cluster time.

public BsonDocument ClusterTime { get; }

Property Value

BsonDocument

The cluster time.

See Also

CurrentTransaction

Gets the current transaction.

public CoreTransaction CurrentTransaction { get; }

Property Value

CoreTransaction

The current transaction.

See Also

Id

Gets the session Id.

public BsonDocument Id { get; }

Property Value

BsonDocument

The session Id.

See Also

Instance

Gets the pre-created instance.

public static ICoreSession Instance { get; }

Property Value

ICoreSession

The instance.

See Also

IsCausallyConsistent

Gets a value indicate whether this instance is causally consistent.

public bool IsCausallyConsistent { get; }

Property Value

bool

true if the session is causally consistent.

See Also

IsDirty

Gets a value indicate whether this session is dirty.

public bool IsDirty { get; }

Property Value

bool

true if the session is dirty.

See Also

IsImplicit

Gets a value indicating whether this instance is implicit session.

public bool IsImplicit { get; }

Property Value

bool

true if this instance is implicit session; otherwise, false.

See Also

IsInTransaction

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

public bool IsInTransaction { get; }

Property Value

bool

true if this instance is in a transaction; otherwise, false.

See Also

IsSnapshot

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

public bool IsSnapshot { get; }

Property Value

bool

true if the session is a snapshot session.

See Also

OperationTime

Gets the operation time.

public BsonTimestamp OperationTime { get; }

Property Value

BsonTimestamp

The operation time.

See Also

Options

Gets the session options.

public CoreSessionOptions Options { get; }

Property Value

CoreSessionOptions

The session options.

See Also

ServerSession

Gets the server session.

public ICoreServerSession ServerSession { get; }

Property Value

ICoreServerSession

The server session.

See Also

SnapshotTime

Gets the snapshot time.

public BsonTimestamp SnapshotTime { get; }

Property Value

BsonTimestamp

The snapshot time.

See Also

Methods

AbortTransaction(CancellationToken)

Aborts the transaction.

public void AbortTransaction(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

The cancellation token.

See Also

AbortTransactionAsync(CancellationToken)

Aborts the transaction.

public Task AbortTransactionAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

The cancellation token.

Returns

Task

A Task.

See Also

AboutToSendCommand()

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

public void AboutToSendCommand()
See Also

AdvanceClusterTime(BsonDocument)

Advances the cluster time.

public void AdvanceClusterTime(BsonDocument newClusterTime)

Parameters

newClusterTime BsonDocument

The new cluster time.

See Also

AdvanceOperationTime(BsonTimestamp)

Advances the operation time.

public void AdvanceOperationTime(BsonTimestamp newOperationTime)

Parameters

newOperationTime BsonTimestamp

The new operation time.

See Also

AdvanceTransactionNumber()

Advances the transaction id.

public long AdvanceTransactionNumber()

Returns

long

The transaction id.

See Also

CommitTransaction(CancellationToken)

Commits the transaction.

public void CommitTransaction(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

The cancellation token.

See Also

CommitTransactionAsync(CancellationToken)

Commits the transaction.

public Task CommitTransactionAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

The cancellation token.

Returns

Task

A Task.

See Also

Dispose()

public void Dispose()
See Also

MarkDirty()

Marks the session as dirty.

public void MarkDirty()
See Also

NewHandle()

Returns a new handle to a NoCoreSession object.

public static ICoreSessionHandle NewHandle()

Returns

ICoreSessionHandle

A new handle to the NoCoreSession object.

See Also

SetSnapshotTimeIfNeeded(BsonTimestamp)

Sets the snapshot time if not set.

public void SetSnapshotTimeIfNeeded(BsonTimestamp snapshotTime)

Parameters

snapshotTime BsonTimestamp

The snapshot time.

See Also

StartTransaction(TransactionOptions)

Starts a transaction.

public void StartTransaction(TransactionOptions transactionOptions = null)

Parameters

transactionOptions TransactionOptions

The transaction options.

See Also

WasUsed()

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

public void WasUsed()
See Also

See Also