ClientSession

interface ClientSession : ClientSession

A client session that supports transactions.

Since

3.8

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
abstract suspend fun abortTransaction()

Abort a transaction in the context of this session. A transaction can only be aborted if one has first been started.

Link copied to clipboard
abstract fun advanceClusterTime(p0: BsonDocument)
Link copied to clipboard
abstract fun advanceOperationTime(p0: BsonTimestamp)
Link copied to clipboard
abstract fun clearTransactionContext()
Link copied to clipboard
abstract override fun close()
Link copied to clipboard
abstract suspend fun commitTransaction()

Commit a transaction in the context of this session. A transaction can only be committed if one has first been started.

Link copied to clipboard
abstract fun getClusterTime(): BsonDocument
Link copied to clipboard
abstract fun getOperationTime(): BsonTimestamp
Link copied to clipboard
abstract fun getOptions(): ClientSessionOptions
Link copied to clipboard
abstract fun getOriginator(): Any
Link copied to clipboard
@Nullable
abstract fun getPinnedServerAddress(): ServerAddress
Link copied to clipboard
@Nullable
abstract fun getRecoveryToken(): BsonDocument
Link copied to clipboard
abstract fun getServerSession(): ServerSession
Link copied to clipboard
@Nullable
abstract fun getSnapshotTimestamp(): BsonTimestamp
Link copied to clipboard
@Nullable
abstract fun getTransactionContext(): Any
Link copied to clipboard
abstract fun hasActiveTransaction(): Boolean

Returns true if there is an active transaction on this session, and false otherwise

Link copied to clipboard
abstract fun isCausallyConsistent(): Boolean
Link copied to clipboard
abstract fun setRecoveryToken(p0: BsonDocument)
Link copied to clipboard
abstract fun setSnapshotTimestamp(p0: BsonTimestamp)
Link copied to clipboard
abstract fun setTransactionContext(p0: ServerAddress, p1: Any)
Link copied to clipboard
abstract fun startTransaction()

Start a transaction in the context of this session with default transaction options. A transaction can not be started if there is already an active transaction on this session.

abstract fun startTransaction(transactionOptions: TransactionOptions)

Start a transaction in the context of this session with the given transaction options. A transaction can not be started if there is already an active transaction on this session.

Properties

Link copied to clipboard
abstract val transactionOptions: TransactionOptions?

Gets the transaction options. Only call this method of the session has an active transaction