-
Type: Bug
-
Resolution: Works as Designed
-
Priority: Major - P3
-
None
-
Affects Version/s: 2.12.3
-
Component/s: Error Handling, Transactions
-
Environment:C#; .NET 5; VS 2019; Windows 10, xunit 2.4.1
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.