ClientSession

class ClientSession(val wrapped: ClientSession) : Closeable

A client session that supports transactions.

Constructors

Link copied to clipboard
constructor(wrapped: ClientSession)

Functions

Link copied to clipboard

Abort a transaction in the context of this session.

Link copied to clipboard
open override fun close()
Link copied to clipboard

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

Link copied to clipboard

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.

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.

Link copied to clipboard
fun <T : Any> withTransaction(transactionBody: () -> T, options: TransactionOptions = TransactionOptions.builder().build()): T

Execute the given function within a transaction.

Properties

Link copied to clipboard

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

Link copied to clipboard

Returns true if operations in this session must be causally consistent

Link copied to clipboard
val options: ClientSessionOptions

The options for this session.

Link copied to clipboard
val transactionOptions: TransactionOptions

Gets the transaction options.

Link copied to clipboard
val wrapped: ClientSession