2

I have an ASP application sitting on 2 servers, using a db in SQL Server 2012. The SQL Server uses AlwaysOn Availability groups but when these failover the client connecting to the ASP.NET application terminates. I have looked into the SQL driver which as it turns out the app is using SqlClasses so not using ODBC driver (from what I have deduced I presume that logic is sound but correct me if I'm wrong).

Another suggestion has been made that I load balance the 2 app servers and that will seamlessly allow failover underneath without the client loosing connection, is this a viable way to go? We don't have much control over the applications code to ask it to try the connection again after failing....

Many thanks in advance.

5
  • 2
    To tell you the truth I do not understand what is the question. Commented Jan 18, 2013 at 23:58
  • sorry, the problem i have is that we have an ASP app that connects to the database. now when this database fails over to another node the connection is dropped and the client connecting to the app sees a connection error. i am trying to find a way that they don't see this and when the database fails over the client doesn't lose the connection and the app server just carries on as and when the database comes back online. network load balancing has been suggested to me as a solution. I just want a wider opinion on this... Commented Jan 19, 2013 at 0:04
  • Now I understand - The first question is why the SQL server fails ? this is very rare, the second question is:Do you have 2 sql servers with the same database ? Commented Jan 19, 2013 at 0:09
  • It doesnt fail for any particular reason, its just when i initiate a failover for something like a patch we dont get the high availability we should because the connection is cut and the app crashes. We have the database in a AlwaysOn availability group so yes its in 3 different servers, presented on a group listener. Commented Jan 19, 2013 at 0:12
  • I suppose that you have follow the tutorials on how you setup that youtube.com/watch?v=CHheIDb6VpI&feature=player_embedded Commented Jan 19, 2013 at 0:22

1 Answer 1

2

Try defining the failover partner in your connection string.

Data Source=myServerAddress;Failover Partner=myMirrorServerAddress; Initial Catalog=myDataBase;Integrated Security=True; 

And also check out MultiSubNetFailover property in .NET 4.5

Sign up to request clarification or add additional context in comments.

1 Comment

Thank you Cyan Lite, the connection used is SqlClient and your post lead me to the discovery of MultiSubnetFailover=True property in the connection string.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.