AlwaysOn and your application source code

Published On: 2012-04-19By:

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


Contact the Author | Contact DCAC

One response to “AlwaysOn and your application source code”

  1. Bugme says:

    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

Video

Globally Recognized Expertise

As Microsoft MVP’s and Partners as well as VMware experts, we are summoned by companies all over the world to fine-tune and problem-solve the most difficult architecture, infrastructure and network challenges.

And sometimes we’re asked to share what we did, at events like Microsoft’s PASS Summit 2015.

Awards & Certifications

Microsoft Partner    Microsoft MVP    Microsoft Certified Master    VMWare Partner    VMWare vExpert
   Best Full-Service Cloud Technology Consulting Company    Insights Sccess Award    Technology Headlines Award    Golden Bridge Gold Award    CIO Review Top 20 Azure Solutions Providers
Share via
Copy link