Class ClientSessionOptions


  • public class ClientSessionOptions
    extends java.lang.Object
    The options to apply to a ClientSession.
    Since:
    3.6
    See Also:
    ClientSession
    Since server release
    3.6
    MongoDB documentation
    Causal Consistency
    • Constructor Detail

      • ClientSessionOptions

        public ClientSessionOptions()
      • ClientSessionOptions

        public ClientSessionOptions​(JsonObject json)
    • Method Detail

      • setCausallyConsistent

        public ClientSessionOptions setCausallyConsistent​(java.lang.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
      • isCausallyConsistent

        public java.lang.Boolean 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
      • setDefaultTransactionOptions

        public ClientSessionOptions setDefaultTransactionOptions​(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
      • getDefaultTransactionOptions

        public TransactionOptions 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