Skip to content

Commit 721aca4

Browse files
committed
deprecations
1 parent 739a254 commit 721aca4

File tree

5 files changed

+34
-27
lines changed

5 files changed

+34
-27
lines changed

source/connection/connection-pools.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,7 @@ see the corresponding syntax:
9393

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

9998
*Default:* ``100``
10099

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

107106
*Default*: ``0``
108107

109-
* - ``waitQueueTimeoutMS``
108+
* - ``waitQueueTimeoutMS`` *(deprecated)*
110109

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

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

source/connection/specify-connection-options/connection-options.txt

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,12 @@ parameters of the connection URI to specify the behavior of the client.
3131

3232
| **Default**: ``100``
3333

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

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

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

106108
* - **timeoutMS**
107109
- integer
108-
- Specifies the time limit, in milliseconds, for the full execution
109-
of an operation. This option sets a client-level operations
110-
timeout that replaces the functionality of the ``maxTimeMS`` and
111-
``maxCommitTimeMS`` options. To learn more, see the :ref:`java-csot`
112-
guide.
110+
- | Specifies the time limit, in milliseconds, for the full execution
111+
of an operation. This option sets a client-level operations
112+
timeout that replaces the functionality of the following
113+
deprecated options:
114+
|
115+
| - ``waitQueueTimeoutMS``
116+
- ``socketTimeoutMS``
117+
- ``wTimeoutMS``
118+
- ``maxTimeMS``
119+
- ``maxCommitTimeMS``
120+
|
121+
| To learn more, see the :ref:`java-csot` guide.
113122

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

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

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

130140
| **Default**: ``0``
131141

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

163173
| **Default**: ``1``
164174

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

172184
| **Default**: ``0``
173185

source/connection/specify-connection-options/csot.txt

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,11 +93,10 @@ accepted values for ``timeoutMS``:
9393
| - :manual:`waitQueueTimeoutMS </reference/connection-string-options/#mongodb-urioption-urioption.waitQueueTimeoutMS>`
9494
- :manual:`socketTimeoutMS </reference/connection-string-options/#mongodb-urioption-urioption.socketTimeoutMS>`
9595
- :manual:`wTimeoutMS </reference/connection-string-options/#mongodb-urioption-urioption.wtimeoutMS>`
96-
- :manual:`maxTimeMS </reference/method/cursor.maxTimeMS/>` *(deprecated)*
97-
- `maxCommitTimeMS <{+core-api+}/com/mongodb/TransactionOptions.Builder.html#maxCommitTime(java.lang.Long,java.util.concurrent.TimeUnit)>`__ *(deprecated)*
96+
- :manual:`maxTimeMS </reference/method/cursor.maxTimeMS/>`
97+
- `maxCommitTimeMS <{+core-api+}/com/mongodb/TransactionOptions.Builder.html#maxCommitTime(java.lang.Long,java.util.concurrent.TimeUnit)>`__
9898
|
99-
| When the CSOT feature is no longer experimental, all the
100-
preceding options will be deprecated.
99+
| These settings are deprecated and are ignored if you set ``timeoutMS``.
101100

102101
If you specify the ``timeoutMS`` option, the driver automatically applies the
103102
specified timeout for each server operation. The following code example specifies

source/crud/compound-operations.txt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,6 @@ following options:
8383

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

9087
.. literalinclude:: /includes/fundamentals/code-snippets/CompoundOperatorsIndividualExamples.java
9188
:language: java

source/includes/fundamentals/code-snippets/CompoundOperatorsIndividualExamples.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,10 @@ private void findOneAndUpdateExample() {
6666
// Creates an update document to set the value of "food" to "pizza"
6767
Bson update = Updates.set("food", "pizza");
6868

69-
// Defines options that specify projected fields, permit an upsert and limit execution time
70-
FindOneAndUpdateOptions options = new FindOneAndUpdateOptions().
71-
projection(projection).
72-
upsert(true).
73-
maxTime(5, TimeUnit.SECONDS);
69+
// Defines options that specify projected fields and permit upserts
70+
FindOneAndUpdateOptions options = new FindOneAndUpdateOptions()
71+
.projection(projection)
72+
.upsert(true);
7473

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

0 commit comments

Comments
 (0)