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

IClientSessionHandle.IsInTransaction remains true even if transaction has been aborted

      IClientSessionHandle.IsInTransaction remains true on aborted transaction because of e.g. MongoWriteException. CommitTransaction excepts afterwards with the message: MongoDB.Driver.MongoCommandException : Command commitTransaction failed: Transaction 1 has been aborted..

      I've attached a complete VS 2019 solution with xunit unit tests to reproduce the behavior. Unit test AbortTransactionOnMongoDbException and ZombieSessionHowEcsDoesItTest4 fail because IsInTransaction is true even after transaction was aborted and therefore CommitTransaction is called. 

        1. MongoDbTest_Fixed.zip
          11 kB
        2. MongoDbTestWithOutBinaries.zip
          187 kB

            Assignee:
            dmitry.lukyanov@mongodb.com Dmitry Lukyanov (Inactive)
            Reporter:
            daniel.camarena@azo.com Daniel Camarena
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: