Why does SqlAzureExecutionStrategy not handle error: 19 - Physical connection is not usable

前端 未结 5 502
我在风中等你
我在风中等你 2021-02-04 07:12

Full exception:

System.Data.Entity.Core.EntityCommandExecutionException: An error occurred while executing the command definition. See the inner exception for de         


        
5条回答
  •  执笔经年
    2021-02-04 07:49

    My present conclusion is this: the list of errors in SqlAzureExecutionStrategy is nothing more than an educated guess by the Entity Framework team; and it is usually out of date because the EF is not updated in synch with SQL Azure.

    I base this conclusion on looking at the history of the list, including a commented out -2 error, and comparing it to other lists in other pieces of code around blogs, the (now obsolete) Transient Error Handling Block, and the ever-changing actual errors that we are personally seeing.

    As long as the two teams and codebases are separate, this approach probably won't work. If they made this list of transient errors a property of SQL server that EF could query and use, and made it the SQL Azure teams job to keep it up to date and accurate, then maybe this solution would work.

    In the meantime, my conclusion is that the only viable strategy which won't randomly break, is to retry every exception. Sure, some of them are probably useless to retry, but the only sure way is to try.

提交回复
热议问题