Cannot get rid of “physical connection is not usable” exception

戏子无情 提交于 2019-11-28 21:13:04

I confirm now, by changing connection string on the server to use "." for data source instead of domain name, exception seem to have disappeared. Very weird as domain name used to work before. Must be some sort of update on SQL Server

I know this is an old post but I've recently had a horrible time with this error and there were no solutions on any of the blogs.

Specific details about my problem: ASP.NET web app with target .NET framework 4.5, MVC ver. 5.2.3, Entity ver. 6.0.0.0, MS SQLServer Express 2014. My dev system is running Windows 7 Pro SP1.

Symptoms: The error came on suddenly (I had not worked on the project for almost three weeks, at which time it had functioned fine). When I started the app, after logging the user in, the second query sent to the database by the Entity framework ALLWAYS generated the error "A transport-level error has occurred when receiving results from the server. (provider: Session Provider, error: 19 - Physical connection is not usable)". It did not matter which table was queried. The error was not intermittent and rebooting the server did not help. The error occurred using IIS and IIS express.

SqlConnection.ClearAllPools() prevented the error for ONE query only, and I did not want to add this before every single Entity call in the program. I tried every single solution on all the blogs to no avail, even solutions to other Transport-Level Errors. I rolled back package updates for my references in an attempt to get back to a working state. Nothing!

The Solution: The culprit was Microsoft SQL Server 2014 SP1 Security update (KB3070446)!! I rolled back this update and everything worked like a charm!

I lost two days of dev work dealing with this problem, hopefully this post can help someone else avoid this agony!

I encountered this error as well. In my case, the issue was that the connection was closed by the database server but the connection remained valid in the connection pool of my app.

Resetting the application pool got my app back up and running.

Had this error after removing MaxDegreeOfParallelism which is set by default to -1 or no limit while setting the db.Database.CommandTimeout = 0.

The suggestion is to set the MaxDegreeOfParallelism explicitly to a safe value.

Another scenario: The network connection is down even for a few seconds while the application is communicating with the server database.

The database connection is closed by the database server. The connection remains valid in the connection pool of your app; as a result, when you pickup the shared connection string and try to execute it's not able to reach the database. If you are developing Visual Studio, simply close the temporary web server on your task bar.

If it happens in production, resetting your application pool for your web site should recycle the connection pool.

Maybe due to an update on Intrusion Prevention System.

Please try to refer to the following thread: http://forums.asp.net/t/1908976.aspx

Hope it can help.

This was a DNS error for me, diagnosed because using the server name in the connection string produced the error, but using the IP worked fine. Open cmd prompt, run a quick ipconfig /flushdns to see if it helps.

I had the same error for 2 days! and didn't even know why it suddenly happened?!!

  • What it turned out to be: I had a Network Authentication Access Issue (Because of my WiFi Connection).. and once I Disconnected/Disabled my WiFi and connected only via a Cable (secured and stable) connection.. the error went away..

  • Also I did the following, such as:

Restarted All SQL Server Services. Restarted My SQLServer Instance. Added these props to my DEF connection string..

Connection Lifetime=30; Max Pool Size=350;Connection Timeout=30;Connection Lifetime=0;ConnectRetryCount=3;ConnectRetryInterval=10; 
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!