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

Migrating from 2.10.3 to 2.11.2 made transactions to fail on a local standalone server

    • Type: Icon: Bug Bug
    • Resolution: Works as Designed
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 2.11.2
    • Component/s: API
    • None
    • Environment:
      OSX (most likely all)

      When we were using the version 2.10.3 we could create simple transactions, but after upgrading to the latest version the client would throw the following error when starting the transaction: 'Standalone servers do not support transaction mongo'.

      I am not sure if this is an intended change or a bug.

       

      Unable to find source-code formatter for language: csharp. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml
      using (var session = mongoClient.StartSession())
                  {
                      try
                      {
                          session.StartTransaction();
      
                          if (insert)
                          {
                              await collection.InsertOneAsync(family);
                              session.CommitTransaction();
                              return true;
                          }
                          else    
                          {
                              var filter = Builders<FamilyModel>.Filter.Eq(x => x.Id, family.Id);
                              var result = await collection.ReplaceOneAsync(filter, family);
                              session.CommitTransaction();
                              return result.ModifiedCount > 0;
                          }
                      }
               }
      

       

            Assignee:
            dmitry.lukyanov@mongodb.com Dmitry Lukyanov (Inactive)
            Reporter:
            jose@ally.se Jose Fernandez Alameda
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: