Sql server 2014, Entity framework 6.1.2, .net framework 4.5, IIS 8, DB mirror in high safety mode with no 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 with: A = Principle, B = Mirror
And when I do a manual failover from A to B (Principle to Mirror), it fails with the Unable to open connection - Erro 40.
Starting with: A = Mirror, B = Principle
Manual failover works.
Now: A = Principle, B = Mirror
I then without restarting the site, failover back again, Error 40.
Restart IIS, works fine again.
Here's the code to test the connection:
while (!_exitFlag)
{
using (var context = new EntityContext())
{
var result = context.Foos.Count();
}
}
Any ideas?