OpenQuizz
Une application de gestion des contenus pédagogiques
TransactionOptions Class Reference
Inheritance diagram for TransactionOptions:
Collaboration diagram for TransactionOptions:

Public Member Functions

def __init__ (self, read_concern=None, write_concern=None, read_preference=None, max_commit_time_ms=None)
 
def read_concern (self)
 
def write_concern (self)
 
def read_preference (self)
 
def max_commit_time_ms (self)
 

Detailed Description

Options for :meth:`ClientSession.start_transaction`.

:Parameters:
  - `read_concern` (optional): The
    :class:`~pymongo.read_concern.ReadConcern` to use for this transaction.
    If ``None`` (the default) the :attr:`read_preference` of
    the :class:`MongoClient` is used.
  - `write_concern` (optional): The
    :class:`~pymongo.write_concern.WriteConcern` to use for this
    transaction. If ``None`` (the default) the :attr:`read_preference` of
    the :class:`MongoClient` is used.
  - `read_preference` (optional): The read preference to use. If
    ``None`` (the default) the :attr:`read_preference` of this
    :class:`MongoClient` is used. See :mod:`~pymongo.read_preferences`
    for options. Transactions which read must use
    :attr:`~pymongo.read_preferences.ReadPreference.PRIMARY`.
  - `max_commit_time_ms` (optional): The maximum amount of time to allow a
    single commitTransaction command to run. This option is an alias for
    maxTimeMS option on the commitTransaction command. If ``None`` (the
    default) maxTimeMS is not used.

.. versionchanged:: 3.9
   Added the ``max_commit_time_ms`` option.

.. versionadded:: 3.7

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self,
  read_concern = None,
  write_concern = None,
  read_preference = None,
  max_commit_time_ms = None 
)

Member Function Documentation

◆ max_commit_time_ms()

def max_commit_time_ms (   self)
The maxTimeMS to use when running a commitTransaction command.

.. versionadded:: 3.9

◆ read_concern()

def read_concern (   self)
This transaction's :class:`~pymongo.read_concern.ReadConcern`.

◆ read_preference()

def read_preference (   self)
This transaction's :class:`~pymongo.read_preferences.ReadPreference`.

◆ write_concern()

def write_concern (   self)
This transaction's :class:`~pymongo.write_concern.WriteConcern`.

The documentation for this class was generated from the following file: