[CSHARP-2331] Misleading Doc Example Code in Transaction Section Created: 17/Jul/18  Updated: 28/Oct/23  Resolved: 21/Aug/18

Status: Closed
Project: C# Driver
Component/s: Documentation
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Minor - P4
Reporter: Ru [X] Assignee: Vincent Kam (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible

 Description   

There is a bug in the c# example code of the transaction section:

https://docs.mongodb.com/master/core/transactions/?_ga=2.203887700.515816747.1531800617-1973885362.1531800617#retry-transaction-and-commit-operation

The example source code is at:

https://github.com/mongodb/mongo-csharp-driver/blob/master/tests/MongoDB.Driver.Examples/TransactionExamplesForDocs/RetryExample3.cs

At line 88 and line 91, when we're doing the update and insert operations, we should pass `session` as the first parameter, in order to put them in the transaction and demonstrate how the transaction works. And that is the purpose of this example.
 



 Comments   
Comment by Vincent Kam (Inactive) [ 21/Aug/18 ]

Thank you for noticing the misleading example and for your pull request!
We've fixed the misleading example code through another pull request (#330) came in slightly earlier.

Generated at Wed Feb 07 21:42:15 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.