I am working on an MVC application that connects to MS SQL Server 2008 R2. The development server is the Express Version - I don't know if that is a contributing factor...
Intermittently, when I run the application from Visual Studio (so it opens in Chrome), I get errors connecting to SQL Server.
Errors such as:
- The semaphore timeout period has expired.
- The underlying provider failed on Open.
This is my connection string (I changed a few words in it before posting it publicly)
<add name="[MyEntities]"
connectionString="metadata=res://*/Models.[publicword].csdl|res://*/Models.[publicword].ssdl|res://*/Models.[publicword].msl;provider=System.Data.SqlClient;provider connection string="data source=thanos;initial catalog=[DatabaseName];Integrated Security=SSPI;multipleactiveresultsets=True;application name=EntityFramework""
providerName="System.Data.EntityClient" />
I have searched via Google quite a bit, without finding anything especially helpful - I am trying to figure out how I could make my application retry once when it gets a connection error, rather than failing, considering it almost always works on the second try.
Any suggestions of where to start? I don't have access to mess with the server as an Admin but if that's the place to address this, I can probably coordinate with the person who is an Admin.
I am considering it possible that this is somewhat related to running the application locally - the database is on a server some miles away from where I am located. Once the application is deployed to the server, the application will be running on the same physical box as the database. But I don't feel good enough about that to assume that everything will be fine - I don't want to get to Production with this assumption just to find out I was wrong...