Azure SQL Database, EF Core EnableRetryOnFailure, and Connection Resiliency
See original GitHub issueI’m checking in to using Azure SQL Database, and everything seems to be working well so far.
There is an option, however, that I must enable when the db context is configured to retry the connections on failure:
builder.UseSqlServer(connectionString, opt => opt.EnableRetryOnFailure());
When a query is made, it throws the following exception:
InvalidOperationException: The configured execution strategy 'SqlServerRetryingExecutionStrategy' does not support user initiated transactions. Use the execution strategy returned by 'DbContext.Database.CreateExecutionStrategy()' to execute all the operations in the transaction as a retriable unit.
There is more information about it here: https://docs.microsoft.com/en-us/ef/core/miscellaneous/connection-resiliency
Is there anything I can do in order to make this work?
Issue Analytics
- State:
- Created 5 years ago
- Reactions:7
- Comments:27 (12 by maintainers)
Top GitHub Comments
Yes. It seems this setting EnableRetryOnFailure is critical in order to host on Azure and this setting is not compatible with ABP.
@jacobmhulse I’m adding this item to 7.1 milestone. We will try to work on it after .NET 6 release.