8000 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
api docs + fixes
  • Loading branch information
rustagir committed Mar 20, 2025
commit f941168bad4caf6663c0656dc0a1183e6e74c195
26 changes: 17 additions & 9 deletions source/connection/specify-connection-options/csot.txt
10000
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ timeout of 5 seconds by using each method:
:language: java
:start-after: start-string
:end-before: end-string
:dedent:

Behavior
~~~~~~~~
Expand All @@ -75,7 +76,7 @@ accepted values for ``timeoutMS``:

.. list-table::
:header-rows: 1
:widths: 35 65
:widths: 25 75

* - Value
- Behavior
Expand All @@ -90,10 +91,10 @@ accepted values for ``timeoutMS``:
- | Defers the timeout behavior to the following settings:
|
| - :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:`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)*
|
| When the CSOT feature is no longer experimental, all the
preceding options will be deprecated.
Expand Down Expand Up @@ -159,9 +160,9 @@ Overrides
The {+driver-short+} supports various levels of configuration to control the
behavior and performance of database operations.

You can specify a ``timeoutMS`` option at the operation level to override the
client-level configuration for a specific operation. This allows you to
customize timeouts based on the needs of individual queries.
You can specify a ``timeoutMS`` option at a lower level to override the
client-level configuration. This allows you to customize timeouts based
on the needs of individual operations.

The following example demonstrates how an collection-level timeout
configuration can override a client-level timeout configuration:
Expand Down Expand Up @@ -292,4 +293,11 @@ API Documentation
To learn more about using timeouts with the {+driver-short+}, see the following
API documentation:


- `MongoClientSettings <{+core-api+}/com/mongodb/MongoClientSettings.html>`__
- `MongoClientSettings.Builder.timeout() <{+core-api+}/com/mongodb/MongoClientSettings.Builder.html#timeout(long,java.util.concurrent.TimeUnit)>`__
- `MongoCollection.withTimeout() <{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/MongoCollection.html#withTimeout(long,java.util.concurrent.TimeUnit)>`__
- `ClientSessionOptions.Builder.defaultTimeout() <{+core-api+}/com/mongodb/ClientSessionOptions.Builder.html#defaultTimeout(long,java.util.concurrent.TimeUnit)>`__
- `TransactionOptions.Builder.timeout() <{+core-api+}/com/mongodb/TransactionOptions.Builder.html#timeout(java.lang.Long,java.util.concurrent.TimeUnit)>`__
- `ClientEncryptionSettings.Builder.timeout() <{+core-api+}/com/mongodb/ClientEncryptionSettings.Builder.html#timeout(long,java.util.concurrent.TimeUnit)>`__
- `FindIterable.timeoutMode() <{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/FindIterable.html#timeoutMode(com.mongodb.client.cursor.TimeoutMode)>`__
- `TimeoutMode <{+core-api+}/com/mongodb/client/cursor/TimeoutMode.html>`__
3 changes: 0 additions & 3 deletions source/connection/specify-connection-options/stable-api.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
{+stable-api+}
==============



.. contents:: On this page
:local:
:backlinks: none
Expand Down Expand Up @@ -145,4 +143,3 @@ API Documentation:

- `strict() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/ServerApi.Builder.html#strict(boolean)>`__
- `deprecationErrors() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/ServerApi.Builder.html#>`__

3 changes: 1 addition & 2 deletions source/includes/connect/CSOT.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,7 @@ private void operationTimeout(){
MongoDatabase database = mongoClient.getDatabase("db");
MongoCollection<Document> collection = database.getCollection("people");

InsertOneResult result = collection.insertOne(new Document("name", "Francine Loews"));
System.out.println("Inserted a document with ID: " + result.getInsertedId());
collection.insertOne(new Document("name", "Francine Loews"));
}
// end-operation-timeout
}
Expand Down
Loading
0