Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

http://msdn.microsoft.com/en-us/data/dn456835.aspx

    public class MyConfiguration : DbConfiguration 
    { 
        public MyConfiguration() 
        { 
            SetExecutionStrategy( 
                "System.Data.SqlClient", 
                () => new SqlAzureExecutionStrategy(1, TimeSpan.FromSeconds(30))); 
        } 
    }
The above SqlAzureExecutionStrategy will retry instantly the first time a transient failure occurs, but will delay longer between each retry until either the max retry limit is exceeded or the total time hits the max delay. The execution strategies will only retry a limited number of exceptions that are usually tansient, you will still need to handle other errors as well as catching the RetryLimitExceeded exception for the case where an error is not transient or takes too long to resolve itself.


Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: