Web App Failover problem RRS feed

  • Question

  • Hi,

    I have successfully set-up a DB mirroring.  When the pricipal goes down, the mirror picksup and the other way around too.  So the mirroring part is working great.  However, when I use my web applicaiton (dot net 2.0), it is not able to connect to Mirror server.  I get the following error:

    An error has occurred while establishing a connection to the server.  When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)

    My connection string in web app:

    "Server=serverAAA;Failover Partner=serverBBB;Database=TestDB;User Id=testUser;Password=testPassword;"

    I have checked the surface are config on "serverBBB" and it is set to use tcpip only for remote connections.

    Any suggestions are higly appreciated.  TIA.


    Wednesday, June 7, 2006 7:13 PM


All replies

  • 1. You should allow local and remote connections for TCPIP as well as Named Pipes on the mirror. Use Surface Area Configuration for this.

    2. It appears from your post that your application is successfully able to connect to the server serverAAA. The first thing to do would be to compare the connection settings on serverAAA and serverBBB. It should work if the settings are the same on both the partner servers.

    Friday, June 9, 2006 10:45 PM
  • Thanks for your suggestions.  I am not sure what you mean by

    "The first thing to do would be to compare the connection settings on serverAAA and serverBBB"

    What exactly do I need to compare?  Thanks for your time.

    Sunday, June 11, 2006 11:23 PM
  • I am still waiting for any suggestions.... can't figure out what I am doing wrong.
    Wednesday, June 14, 2006 6:32 PM
  • Hi!

    I've seen this message often enough. You use sql authentication in your connection string what doesn't work.

    One problem is that the dbuser what you use to connect to the principal db will become an orphaned user on the mirror. To check this, iniitiate a failover, delete and recreate the database user on the (new) principal and try to connect with the application.

    Here is an interesting discussion about this and "high availibility":


    By the way, i use integrated security to connect the application to the db now, and it works fine...

    Greetings, Torsten

    Friday, June 16, 2006 7:39 AM
  • Did Torsten's suggestion help resolve the problem?
    Friday, June 23, 2006 5:11 AM
  • I still have the same issue.  When principal DB server goes down, the connection string for my web application doesn't fail over to the mirrored server.  I have even ran a profiler and no connections are made to the mirrored DB.  Does anyone have a working connection string?  Thanks.
    Tuesday, August 15, 2006 8:34 PM
  • Finally, found a KB article released a couple of weeks ago .... I think it is going to fix my problem!



    Friday, August 18, 2006 2:17 PM
  • Hi all

    I have almost same problem, following exBK link I've installed the .NET framework 2.0 fix.

    I'm using a principal and a mirror database with both SQL2005 SP1, and a witness with SQLEXPRESS SP1 (high safety with automatic failover).

    I'm using certificates, because I'm not on a domain.

    After some tests I found that

    • if my application (windows) is started from zero then everything is going very well, ne error messages.
    • If I run a command from inside my application then it takes 30 secs (and after I get the timeout error) to switch to the failover partner.

    Actually I haven't found any solution to this,any suggestion is greatly appreciated!!


    Sunday, August 20, 2006 2:05 PM