Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DOCSP-4466 Add CSOT #951

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
Prev Previous commit
Next Next commit
expand transactions section and add reference links
stephmarie17 committed Dec 16, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit 703252c9d93759da76dae04a3a6104418f954775
25 changes: 21 additions & 4 deletions source/fundamentals/connection/csot.txt
Original file line number Diff line number Diff line change
@@ -94,11 +94,27 @@ configuration can override a client-level ``timeoutMS`` configuration:
:start-after: start-csot
:end-before: end-csot

.. tip:: Transactions and timeoutMS
Transactions
~~~~~~~~~~~~

If you try to override the ``timeoutMS`` option at the operation level for
operations using the explicit session inside the ``withTransaction``
callback, it throws an error.
When you create a new ``ClientSession`` instance to implement a transaction, use
the ``defaultTimeoutMS`` option. You can set ``defaultTimeoutMS`` to specify the
``timeoutMS`` values to use for:

- `commitTransaction()
<{+api+}/classes/ClientSession.html#commitTransaction>`__
- `abortTransaction()
<{+api+}/classes/ClientSession.html#abortTransaction>`__
- `withTransaction() <{+api+}/classes/ClientSession.html#withTransaction>`__
- `endSession()
<{+api+}/classes/ClientSession.html#endSession>`__

If you do not specify ``defaultTimeoutMS``, the driver uses the ``timeoutMS``
value set on the parent ``MongoClient``.

If you try to override ``defaultTimeoutMS`` by setting the ``timeoutMS`` option
at the operation level for operations using the explicit session inside the
``withTransaction()`` callback, it throws an error.
stephmarie17 marked this conversation as resolved.
Show resolved Hide resolved

ClientEncryption
stephmarie17 marked this conversation as resolved.
Show resolved Hide resolved
~~~~~~~~~~~~~~~~~
@@ -171,3 +187,4 @@ API documentation:

- `MongoClient <{+api+}/classes/MongoClient.html>`__
- `timeoutMS <{+api+}/classes/MongoClient.html#timeoutMS>`__
- `ClientSession <{+api+}/classes/ClientSession.html>`__