We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 41956ed commit 4ea3f9cCopy full SHA for 4ea3f9c
src/MongoDB.Driver.Core/Core/Bindings/CoreSession.cs
@@ -322,13 +322,19 @@ public void Dispose()
322
{
323
if (_currentTransaction != null)
324
325
- try
326
- {
327
- AbortTransaction(CancellationToken.None);
328
- }
329
- catch
+ switch (_currentTransaction.State)
330
331
- // ignore exceptions
+ case CoreTransactionState.Starting:
+ case CoreTransactionState.InProgress:
+ try
+ {
+ AbortTransaction(CancellationToken.None);
332
+ }
333
+ catch
334
335
+ // ignore exceptions
336
337
+ break;
338
}
339
340
0 commit comments