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

> Key problems include connection issues with SQL Server,

What sort? If it's intermediate connection problems .NET 4.5.1 added Connection Resiliency to ADO.NET [1]. If you're using a recent enough version of Entity Framework it goes even further [2].

[1] http://dpaoliello.wordpress.com/2014/03/30/connection-resili...

[2] http://thedatafarm.com/data-access/ef6-connection-resiliency...



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.


Yeah, we use .Net 4.5.3, without EF. Connections still fail all the time especially under high demand.

We have our own retry logic, which also logs the issue so we are aware of how frequently errors occur while a command / transaction is being executed.

This is using SQL Azure with the "Business" tier, so it will be interesting to see how the new (much more highly priced tiers) Standard and Premium tiers go.




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

Search: