'Application has intermittent connection errors when connecting to SQL Server
We have an MVC4 application hosted on a VM server that uses an entityframework style connection string to connect to an instance of SQL server hosted on another VM server on the same ESX host, both are also on the same subnet IP address range i.e. 172.16.164.XX. The problem we are encountering is that if the application has not been used by users for a short while and a user then attempts to access the application, the user will fail to connect to the db to retrieve data. They will attempt a number of times and eventually the application will successfully connect to the DB and the application can be used without any issues or connection failures.
These are the typical errors returned by the application...this is what was recorded in the logs when I attempted to login today (this happened about 9 times before success):
System.Data.SqlClient.SqlException (0x80131904): A connection was successfully established with the server, but then an error occurred during the pre-login handshake. (provider: TCP Provider, error: 0 - The specified network name is no longer available.) ---> System.ComponentModel.Win32Exception (0x80004005): The specified network name is no longer available
System.Data.SqlClient.SqlException (0x80131904): A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) ---> System.ComponentModel.Win32Exception (0x80004005): The network path was not found
System.Data.SqlClient.SqlException (0x80131904): A connection was successfully established with the server, but then an error occurred during the login process. (provider: SSL Provider, error: 0 - The specified network name is no longer available.) ---> System.ComponentModel.Win32Exception (0x80004005): The specified network name is no longer available
We thought it could have something to do with our DNS server but we have added the SQL server IP address and host name to the host file on the application server. We have also added the SQL server IP address to the connection string in the web.config, but this behavior persists. Any help or suggestions appreciated -we are really struggling to find a solution to this issue
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
