We are implementing EnableRetryOnFailure
but as discussed on https://docs.microsoft.com/en-us/ef/core/miscellaneous/connection-resiliency, this does not work out of the box for user defined transactions.
One of the recommendations from the above link (options 3 & 4) is to use an ExecutionStrategy.ExecuteInTransaction
, and to call SaveChanges
with acceptAllChangesOnSuccess: false
.
This is necessary so that the transaction can be retried if SaveChanges succeeds but the transaction fails.
The issue we are having is that we have UserManager
methods wrapped up inside our transactions, and these will internally be calling SaveChanges
on the context.
How can we do this, when we cannot change UserManager
to use acceptAllChangesOnSuccess: false
?