Package com.mongodb
Class ClientSessionOptions
java.lang.Object
com.mongodb.ClientSessionOptions
The options to apply to a
ClientSession.- Since:
- 3.6
- See Also:
- MongoDB documentation
- Causal Consistency
- Since server release
- 3.6
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classA builder for instances ofClientSession -
Method Summary
Modifier and TypeMethodDescriptionstatic ClientSessionOptions.Builderbuilder()Gets an instance of a builderstatic ClientSessionOptions.Builderbuilder(ClientSessionOptions options) Gets an instance of a builder initialized with the given optionsbooleangetDefaultTimeout(TimeUnit timeUnit) Gets the default time limit for the following operations executed on the session:commitTransactionabortTransactionwithTransactioncloseGets the default transaction options for the session.inthashCode()Whether operations using the session should causally consistent with each other.Whether read operations using this session should all share the same snapshot.toString()
-
Method Details
-
isCausallyConsistent
Whether operations using the session should causally consistent with each other.- Returns:
- whether operations using the session should be causally consistent. A null value indicates to use the global default, which is currently true.
- MongoDB documentation
- Causal Consistency
-
isSnapshot
Whether read operations using this session should all share the same snapshot.- Returns:
- whether read operations using this session should all share the same snapshot. A null value indicates to use the global default, which is false.
- Since:
- 4.3
- MongoDB documentation
- Snapshot reads
- Since server release
- 5.0
-
getDefaultTransactionOptions
Gets the default transaction options for the session.- Returns:
- the default transaction options for the session
- Since:
- 3.8
- Since server release
- 4.0
-
getDefaultTimeout
Gets the default time limit for the following operations executed on the session:commitTransactionabortTransactionwithTransactionclose
- Parameters:
timeUnit- the time unit- Returns:
- the default timeout
- Since:
- 5.2
-
equals
-
hashCode
public int hashCode() -
toString
-
builder
Gets an instance of a builder- Returns:
- a builder instance
-
builder
Gets an instance of a builder initialized with the given options- Parameters:
options- the options with which to initialize the builder- Returns:
- a builder instance
- Since:
- 3.8
-