One of the things that people will need to change to their applications when using AlwaysOn under SQL Server 2012 will be that the applications will need to have retry logic added to the application so that if the SQL Server is down that the application can retry the connection.
Now this shouldn’t be anything new to the application developers as even today there’s nothing that says that the SQL Server database will always be available. Instead of failing the application on the first connection attempt, or the first time that the command was run, the command should be rerun, probably a couple of times. Now if the error that you get back is from the SQL Server itself you don’t want to retry. You’ll only want to retry if the database was up and you got back a normal error message.
If you are working with SQL Azure this same logic applies to your application there as well.
While I’d love to provide you with some sample source code here, I’m not a .NET developer and the last thing that you want me doing is writing .NET source code so I’ll leave that for the .NET professionals.
Denny
One Response
Take a look at [A href=”http://windowsazurecat.com/2010/10/best-practices-for-handling-transient-conditions-in-sql-azure-client-applications/”]Best Practices for Handling Transient Conditions in SQL Azure Client Applications[/A]
and the sample code: http://code.msdn.microsoft.com/Transient-Fault-Handling-b209151f