SqlServer mirrored disk fault tolerance with EF6 error Principle for mirroring only

Sql server 2014, Entity 6.1.2 infrastructure, .net framework 4.5, IIS 8, database mirror in enhanced security mode without a witness.

I have the following connection string

Data Source=A;Failover Partner=B;Initial Catalog=DB;Integrated Security=False;User Id=sa;Password=Password;MultipleActiveResultSets=true;Connect Timeout=10

Starting from: A = Principle, B = Mirror
And when I perform a manual transition from A to B (mirroring principle), it crashes with the inability to open the connection - Erro 40.

Starting from: A = Mirror, B = Principle
Manual fail-safe operation.
Now: A = Principle, B = Mirror
Then I do not restart the site, returning again, Error 40.
Restart IIS, stop working again.

Here is the code to test the connection:

while (!_exitFlag)
{
    using (var context = new EntityContext())
    {
        var result = context.Foos.Count();
    }
}

Any ideas?

+4
1

, , lan, , sql, .

SELECT DB_NAME(database_id) AS 'DatabaseName', mirroring_partner_instance
FROM sys.database_mirroring WHERE mirroring_guid IS NOT NULL;  

"" , .net . "pingable" , .net.

, ado.net , " ", STRING. ( Microsoft.)

, , , -, , , " " .

: http://blogs.msdn.com/b/spike/archive/2010/12/15/running-a-database-mirror-setup-with-the-sqlbrowser-service-off-may-produce-unexpected-results.aspx ( .)

. , , : https://dba.stackexchange.com/questions/87607/set-up-sql-server-db-mirror-specifying-ip-address-for-mirroring-partner-instance

+2

Source: https://habr.com/ru/post/1569949/


All Articles