[DRIVERS-2606] Simplify transaction options in convenient API doc example code Created: 14/Apr/23  Updated: 21/Aug/23

Status: Implementing
Project: Drivers
Component/s: Docs Examples
Fix Version/s: None

Type: Task Priority: Unknown
Reporter: Jeremy Mikola Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Issue split
split to NODE-5210 Simplify transaction options in conve... Backlog
split to RUBY-3243 Simplify transaction options in conve... Backlog
split to CDRIVER-4618 Simplify transaction options in conve... Backlog
split to CXX-2679 Simplify transaction options in conve... Backlog
split to GODRIVER-2814 Simplify transaction options in conve... Backlog
split to MOTOR-1123 Simplify transaction options in conve... Backlog
split to PYTHON-3674 Simplify transaction options in conve... Backlog
split to CSHARP-4620 Simplify transaction options in conve... Closed
split to JAVA-4945 Simplify transaction options in conve... Closed
split to PHPLIB-1120 Simplify transaction options in conve... Closed
split to RUST-1637 Simplify transaction options in conve... Closed
Related
is related to DRIVERS-655 Provide transaction example using new... Closed
Driver Changes: Needed
Downstream Changes Summary:

Teams will need to update their documentation examples for transactions. After each language ticket is merged, the assignee should then open a new DOCSP ticket with a "Server" component to inform the docs team to pull in the updated examples.

The above pertains to language-specific examples that are rendered in the MongoDB manual. Any docs owned by the language team can be directly updated.

Start date:
Driver Compliance:
Key Status/Resolution FixVersion
CDRIVER-4618 Backlog
CXX-2679 Backlog
CSHARP-4620 Done
GODRIVER-2814 Backlog
JAVA-4945 Duplicate
NODE-5210 Backlog
MOTOR-1123 Backlog
PYTHON-3674 Backlog
PHPLIB-1120 Fixed 1.16.0
RUBY-3243 Backlog
RUST-1637 Fixed 2.6.0

 Description   

Summary

What is the problem or use case, what are we trying to achieve?

The Convenient API for Transactions examples in the MongoDB manual use the following options:

  • "local" read concern
  • "primary" read preference
  • "majority" write concern with wTimeoutMS=1000

These no longer seem relevant and I propose removing them.

  • The "local" read concern is already the default.
  • The callback function is only executing write operations so a read preference is unnecessary
  • Atlas connection strings include w=majority by default, although perhaps we'd want to keep that in place for non-Atlas users.
  • I don't know what the purpose of wTimeoutMS is here, or why we'd want to invite a replication timeout

This came up while reviewing the Unit 2 Lesson 6 script for upcoming PHP courses, which copied with_transaction() examples from
https://www.mongodb.com/docs/manual/core/transactions/.

Motivation

Who is the affected end user?

Documentation readers.

How does this affect the end user?

The documentation may be unnecessarily verbose.

Is this issue urgent?

No.

Is this ticket required by a downstream team?

The docs team would need to be informed to republish language examples after drivers implement this change.

Is this ticket only for tests?

Yes (since documentation examples are run in driver test suites).


Generated at Thu Feb 08 08:25:59 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.