Package com.mongodb
Class ClientSessionOptions.Builder
- java.lang.Object
-
- com.mongodb.ClientSessionOptions.Builder
-
- Enclosing class:
- ClientSessionOptions
@NotThreadSafe public static final class ClientSessionOptions.Builder extends Object
A builder for instances ofClientSession
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ClientSessionOptions
build()
Build the session options instance.ClientSessionOptions.Builder
causallyConsistent(boolean causallyConsistent)
Sets whether operations using the session should causally consistent with each other.ClientSessionOptions.Builder
defaultTransactionOptions(TransactionOptions defaultTransactionOptions)
Sets whether operations using the session should causally consistent with each other.
-
-
-
Method Detail
-
causallyConsistent
public ClientSessionOptions.Builder causallyConsistent(boolean causallyConsistent)
Sets whether operations using the session should causally consistent with each other.- Parameters:
causallyConsistent
- whether operations using the session should be causally consistent- Returns:
- this
- MongoDB documentation
- Causal Consistency
-
defaultTransactionOptions
public ClientSessionOptions.Builder defaultTransactionOptions(TransactionOptions defaultTransactionOptions)
Sets whether operations using the session should causally consistent with each other.- Parameters:
defaultTransactionOptions
- the default transaction options to use for all transactions on this session,- Returns:
- this
- Since:
- 3.8
- Since server release
- 4.0
-
build
public ClientSessionOptions build()
Build the session options instance.- Returns:
- The
ClientSessionOptions
-
-