Uploaded image for project: 'C# Driver'
  1. C# Driver
  2. CSHARP-2331

Misleading Doc Example Code in Transaction Section

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor - P4
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Documentation
    • Labels:
      None
    • 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.
       

        Attachments

          Activity

            People

            • Assignee:
              vincent.kam Vincent Kam
              Reporter:
              Jolin Ru
              Participants:
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: