You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: source/crud/configure.txt
+39-3Lines changed: 39 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -307,24 +307,60 @@ tab to see corresponding code for each approach:
307
307
:tabid: settings
308
308
309
309
.. literalinclude:: /includes/configure-crud.kt
310
-
:language: rust
310
+
:language: kotlin
311
311
:dedent:
312
312
:start-after: start-local-threshold-settings
313
313
:end-before: end-local-threshold-settings
314
314
315
-
316
315
.. tab:: Connection URI
317
316
:tabid: uri
318
317
319
318
.. literalinclude:: /includes/configure-crud.kt
320
-
:language: rust
319
+
:language: kotlin
321
320
:dedent:
322
321
:start-after: start-local-threshold-uri
323
322
:end-before: end-local-threshold-uri
324
323
325
324
In the preceding example, the {+driver-short+} distributes reads among matching members
326
325
within 35 milliseconds of the closest member's ping time.
327
326
327
+
Retryable Reads and Writes
328
+
--------------------------
329
+
330
+
The {+driver-short+} automatically retries certain read and write operations a single time
331
+
if they fail due to a network or server error.
332
+
333
+
You can explicitly disable retryable reads or retryable writes by setting the ``retryReads`` or
334
+
``retryWrites`` option to ``false`` in a ``MongoClientSettings`` instance. You can also
335
+
set the ``retryReads`` or ``retryWrites`` options in your connection URI.
336
+
337
+
The following example sets both retryable reads and retryable writes to ``false``. Select the :guilabel:`MongoClientSettings` or :guilabel:`Connection URI`
338
+
tab to see corresponding code for each approach:
339
+
340
+
.. tabs::
341
+
342
+
.. tab:: MongoClientSettings
343
+
:tabid: settings
344
+
345
+
.. literalinclude:: /includes/configure-crud.kt
346
+
:language: kotlin
347
+
:dedent:
348
+
:start-after: start-retryable-reads-writes
349
+
:end-before: end-retryable-reads-writes
350
+
351
+
.. tab:: Connection URI
352
+
:tabid: uri
353
+
354
+
.. literalinclude:: /includes/configure-crud.kt
355
+
:language: kotlin
356
+
:dedent:
357
+
:start-after: start-retryable-reads-writes-uri
358
+
:end-before: end-retryable-reads-writes-uri
359
+
360
+
To learn more about supported retryable read operations, see :manual:`Retryable Reads </core/retryable-reads/>`
361
+
in the {+mdb-server+} manual. To learn more about supported retryable write
362
+
operations, see :manual:`Retryable Writes </core/retryable-writes/>` in the {+mdb-server+} manual.
0 commit comments