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

Multiple startTransaction: true for simultaneous operations

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Works as Designed
    • Icon: Major - P3 Major - P3
    • None
    • 2.7.2
    • Transactions
    • None
    • Windows 10

    Description

      When we need to use code like this:

      var userId = @event.UserId;
       
      await Task.WhenAll(
       CreateInitialSettings(userId),
       CreateWidgets(userId),
       CreatePersonalGroup(userId),
       CreateIncomingMessage(userId)
      ); 
      

      causes error: Cannot specify 'startTransaction' on transaction 1 since it is already in progress.

      All this operations go to Mongo with startTransaction: true argument, but only first operation must use this option.

      This very strange behaviour in Server API and looks like crutch. (as it looks now)

      Why we use session.StartTransaction() and operations must known about transaction ? Why this logic leaked from sessions to operations?

      This bug is not driver bug, but you need to fix it on your side.

      Attachments

        Activity

          People

            Unassigned Unassigned
            zoxexivo@gmail.com Ivan Artemov
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: