Quantcast
Channel: Entity Framework
Viewing all articles
Browse latest Browse all 10318

Edited Feature: Allow for suspending retry behavior in SqlAzureExecutionStrategy [1255]

$
0
0
This is based on a discussion we had today in the design meeting: Currently connection resiliency restricts by design patterns that cannot be safely retried:

1. Streaming queries
2. User initiated transactions

The restrictions are necessary for the correct operation of retries but it is very limiting because the configuration of an execution strategy such as SqlAzureExecutionStrategy is permanent and at the AppDomain level.

It seems it could be useful to be able to temporary suspend the retry policy of the execution strategy for a given scope and to at the same time temporary enable streaming queries and user initiated transactions. Currently we don't have a way of doing this in SqlAzureExecutionStrategy, but it should be possible to implement it - even in a custom execution strategy - basically changing the value returned by RetriesOnFailure and disabling retries.

Note that if we could have done something like this for EF6 we could have chosen to automatically setup the current SqlAzureExecutionStrategy for SQL Server but leave it in a suspended mode by default. This would be in fact a different experience from what we have.

__Open issues:__
1. What is the scope of the suspension? Ideally instead of global it should be local to the EF context or to the current execution context.
2. Do we need to encourage people to resume? It is scoped to the EF context probably not.
3. How does the API look like? Depending on #1 and #2 the following options have could work best:
* Static property on SqlAzureExecutionStrategy or DbExecutionStrategy
* Flag in DbContextConfiguration and ObjectContextOptions
* Static method taking a delegate on the execution strategies
* IDisposable suspension scope object
* Etc.

Viewing all articles
Browse latest Browse all 10318

Trending Articles