10000 DOCSP-35923: csot page by rustagir · Pull Request #657 · mongodb/docs-java · GitHub
[go: up one dir, main page]

Skip to content

DOCSP-35923: csot page #657

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

Merged
merged 12 commits into from
Mar 31, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
deprecations
  • Loading branch information
rustagir committed Mar 20, 2025
commit 721aca46e6d72555e45e71eed2a4b9d01aab7865
8 changes: 4 additions & 4 deletions source/connection/connection-pools.txt
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,7 @@ see the corresponding syntax:

- Maximum number of connections opened in the pool. When the
connection pool reaches the maximum number of connections, new
connections wait up until to the value of
``waitQueueTimeoutMS``.
connections wait up for the amount of time set by ``timeoutMS``.

*Default:* ``100``

Expand All @@ -106,11 +105,12 @@ see the corresponding syntax:

*Default*: ``0``

* - ``waitQueueTimeoutMS``
* - ``waitQueueTimeoutMS`` *(deprecated)*

- Maximum wait time in milliseconds that an operation can wait for
a connection to become available. A value of ``0`` means there
is no limit.
is no limit. Set the :ref:`client-level timeout <java-csot>` to
replace the functionality of this deprecated option.

*Default*: ``120000`` (120 seconds)

Expand Down
34 changes: 23 additions & 11 deletions source/connection/specify-connection-options/connection-options.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,12 @@ parameters of the connection URI to specify the behavior of the client.

| **Default**: ``100``

* - **waitQueueTimeoutMS**
* - **waitQueueTimeoutMS** *(deprecated)*
- integer
- Specifies the maximum amount of time, in milliseconds that a
thread can wait for a connection to become available.
thread can wait for a connection to become available. Set the
:ref:`client-level timeout <java-csot>` to replace the
functionality of this deprecated option.

| **Default**: ``120000`` (120 seconds)

Expand Down Expand Up @@ -105,11 +107,18 @@ parameters of the connection URI to specify the behavior of the client.

* - **timeoutMS**
- integer
- Specifies the time limit, in milliseconds, for the full execution
of an operation. This option sets a client-level operations
timeout that replaces the functionality of the ``maxTimeMS`` and
``maxCommitTimeMS`` options. To learn more, see the :ref:`java-csot`
guide.
- | Specifies the time limit, in milliseconds, for the full execution
of an operation. This option sets a client-level operations
timeout that replaces the functionality of the following
deprecated options:
|
| - ``waitQueueTimeoutMS``
- ``socketTimeoutMS``
- ``wTimeoutMS``
- ``maxTimeMS``
- ``maxCommitTimeMS``
|
| To learn more, see the :ref:`java-csot` guide.

* - **connectTimeoutMS**
- integer
Expand All @@ -120,12 +129,13 @@ parameters of the connection URI to specify the behavior of the client.

| **Default**: ``10000`` (10 seconds)

* - **socketTimeoutMS**
* - **socketTimeoutMS** *(deprecated)*
- integer
- Specifies the maximum amount of time, in milliseconds, the Java
driver will wait to send or receive a request before timing out.
A value of ``0`` instructs the driver to never time out while waiting
to send or receive a request.
to send or receive a request. Set the :ref:`client-level timeout
<java-csot>` to replace the functionality of this deprecated option.

| **Default**: ``0``

Expand Down Expand Up @@ -162,12 +172,14 @@ parameters of the connection URI to specify the behavior of the client.

| **Default**: ``1``

* - **wtimeoutMS**
* - **wtimeoutMS** *(deprecated)*
- integer
- Specifies a time limit, in milliseconds, for the write concern. For
more information, see the server documentation for the
:manual:`wtimeoutMS option </reference/connection-string/#write-concern-options>`.
A value of ``0`` instructs the driver to never time out write operations.
A value of ``0`` instructs the driver to never time out write operations. Set the
:ref:`client-level timeout <java-csot>` to replace the
functionality of this deprecated option.

| **Default**: ``0``

Expand Down
7 changes: 3 additions & 4 deletions source/connection/specify-connection-options/csot.txt
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,10 @@ accepted values for ``timeoutMS``:
| - :manual:`waitQueueTimeoutMS </reference/connection-string-options/#mongodb-urioption-urioption.waitQueueTimeoutMS>`
- :manual:`socketTimeoutMS </reference/connection-string-options/#mongodb-urioption-urioption.socketTimeoutMS>`
- :manual:`wTimeoutMS </reference/connection-string-options/#mongodb-urioption-urioption.wtimeoutMS>`
- :manual:`maxTimeMS </reference/method/cursor.maxTimeMS/>` *(deprecated)*
- `maxCommitTimeMS <{+core-api+}/com/mongodb/TransactionOptions.Builder.html#maxCommitTime(java.lang.Long,java.util.concurrent.TimeUnit)>`__ *(deprecated)*
- :manual:`maxTimeMS </reference/method/cursor.maxTimeMS/>`
- `maxCommitTimeMS <{+core-api+}/com/mongodb/TransactionOptions.Builder.html#maxCommitTime(java.lang.Long,java.util.concurrent.TimeUnit)>`__
|
| When the CSOT feature is no longer experimental, all the
preceding options will be deprecated.
| These settings are deprecated and are ignored if you set ``timeoutMS``.

If you specify the ``timeoutMS`` option, the driver automatically applies the
specified timeout for each server operation. The following code example specifies
Expand Down
3 changes: 0 additions & 3 deletions source/crud/compound-operations.txt
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,6 @@ following options:

- Exclude the ``_id`` field from the found document with a projection.
- Specify an upsert, which inserts the document specified by the query filter if no documents match the query.
- Set a maximum execution time of 5 seconds for this operation on the MongoDB
instance. If the operation takes longer, the ``findOneAndUpdate()`` method
will throw a ``MongoExecutionTimeoutException``.

.. literalinclude:: /includes/fundamentals/code-snippets/CompoundOperatorsIndividualExamples.java
:language: java
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,10 @@ private void findOneAndUpdateExample() {
// Creates an update document to set the value of "food" to "pizza"
Bson update = Updates.set("food", "pizza");

// Defines options that specify projected fields, permit an upsert and limit execution time
FindOneAndUpdateOptions options = new FindOneAndUpdateOptions().
projection(projection).
upsert(true).
maxTime(5, TimeUnit.SECONDS);
// Defines options that specify projected fields and permit upserts
FindOneAndUpdateOptions options = new FindOneAndUpdateOptions()
.projection(projection)
.upsert(true);

// Updates the first matching document with the content of the update document, applying the specified options
Document result = collection.findOneAndUpdate(filter, update, options);
Expand Down
Loading
0