Skip to content
This repository was archived by the owner on Apr 20, 2019. It is now read-only.

Commit dfe12cf

Browse files
committed
CSHARP-2287: RetryWrites=true in a transaction throws exception when using async writes.
1 parent 14e046f commit dfe12cf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/MongoDB.Driver.Core/Core/Operations/RetryableWriteOperationExecutor.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ public async static Task<TResult> ExecuteAsync<TResult>(IRetryableWriteOperation
8686

8787
public static async Task<TResult> ExecuteAsync<TResult>(IRetryableWriteOperation<TResult> operation, RetryableWriteContext context, CancellationToken cancellationToken)
8888
{
89-
if (!context.RetryRequested || !AreRetryableWritesSupported(context.Channel.ConnectionDescription))
89+
if (!context.RetryRequested || !AreRetryableWritesSupported(context.Channel.ConnectionDescription) || context.Binding.Session.IsInTransaction)
9090
{
9191
return await operation.ExecuteAttemptAsync(context, 1, null, cancellationToken).ConfigureAwait(false);
9292
}

0 commit comments

Comments
 (0)