Repository navigation
Retryable transactions - #2098
Merged
Merged
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #2098 +/- ##
=======================================
Coverage 92.14% 92.14%
=======================================
Files 366 366
Lines 12079 12124 +45
Branches 2032 2038 +6
=======================================
+ Hits 11130 11172 +42
+ Misses 585 584 -1
- Partials 364 368 +4 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds support for retryable transactions in atomic:operations requests. Retryable transactions are enabled by default in Aspire projects.
You can enable them in regular projects via EF Core options, for example:
Before this PR, operations requests would fail with:
Bugfix in this PR: When commit fails, the error source pointer was set to the last operation; it is now set to the list of operations.
To support this feature, the following breaking change to the public API surface was made:
public interface IOperationsTransactionFactory { - Task<IOperationsTransaction> BeginTransactionAsync(CancellationToken cancellationToken); + Task<TResult> RunInTransactionAsync<TResult>(Func<IOperationsTransaction, Task<TResult>> asyncAction, CancellationToken cancellationToken); }The new method takes a callback where the retryable logic runs. DapperExample was updated for the new interface, but does not support retries. A compatible version of JsonApiDotNetCore.MongoDb will follow soon after this is released.
Closes #2095.
QUALITY CHECKLIST