Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow execution strategy bypass #25041

Merged

Conversation

martincostello
Copy link
Member

Do not throw an exception on the first execution of an execution strategy if a transaction is pending when MaxRetryCount is zero.

This follows the suggested implementation in #24922 (comment).

I've added a unit test for the async and sync execution paths using the example code in #24922 as the starting point.

Do not throw an exception on the first execution of an execution
strategy if a transaction is pending when MaxRetryCount is zero.
Addresses dotnet#24922.
|| Dependencies.CurrentContext.Context.Database.GetEnlistedTransaction() is not null
|| (((IDatabaseFacadeDependenciesAccessor)Dependencies.CurrentContext.Context.Database).Dependencies.TransactionManager as
ITransactionEnlistmentManager)?.CurrentAmbientTransaction is not null)
if (RetriesOnFailure)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Combine with next if to avoid nesting.

Combine with the if to avoid nesting and resolve PR feedback.
@AndriySvyryd AndriySvyryd merged commit eb2cc88 into dotnet:main Jun 9, 2021
@AndriySvyryd
Copy link
Member

Thanks for your contribution.

@martincostello martincostello deleted the Allow-Bypass-Execution-Strategy-24922 branch June 10, 2021 06:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants