Cannot get rid of "physical connection is not usable" exception

asp.net-mvc entity-framework ioc-container sql-server unity-container

Question

I'm about to commit suicide. I have been working on this problem for several weeks. We have an ASP.NET MVC 4 web application that makes use of Unity for IoC, SQL Server 2012 and Entity Framework as ORM. Amazon EC2 hosts the web application. I started getting the exception "Physical connection is not usable." A few times a day, it occurs. I looked through a lot of articles and discussion boards and attempted every advice I could find:

  • I tried setting "Polling=False" in the connection string to disable pooling.
  • restricted the size of the pool and the connection lifetime
  • Attempts were made to switch Unity's LifetimeManager to HierarchicalLifetimeManager and PerRequestLifetimeManager. made sure the entities context is removed after the request is finished.
  • Deleted all references to TransactionScope

It is extremely unfortunate that the only option to fix an exception is to restart the server.

This is a complete exception:

The request was sent to the server with a transport-level error. (Provider: Session Provider, Error: 19 - Unusable Physical Connection)

1
25
3/28/2014 1:43:05 PM

Accepted Answer

I can now validate that the issue appears to have vanished after updating the connection string on the server to use "." for the data source rather than the domain name. Very strange because the domain name used to function. There must be a SQL Server update.

7
4/7/2014 2:51:23 AM

Popular Answer

I'm aware that this post is old, but I recently had a terrible experience with this problem and couldn't find any answers on any of the blogs.

specifics regarding my issue: ASP.NET web application with the following specifications: Entity version 6.0.0.0, MVC version 5.2.3, and MS SQLServer Express 2014. Windows 7 Pro SP1 is installed on my development computer.

Symptoms: The flaw appeared quickly (I had not worked on the project for almost three weeks, at which time it had functioned fine). The second query the Entity framework performed to the database after logging the user in when I first launched the app ALWAYS produced the error "Receiving results from the server resulted in a transport-level error. (Provider: Session Provider, Error: 19 - Unusable Physical Connection)." It made no difference which table was asked about. Rebooting the server did not solve the problem because the error was constant. IIS and IIS express were both used when the issue happened.

SqlConnection. I did not want to put ClearAllPools() before each and every Entity call in the program because it only fixed the error for ONE query. I tried every single fix on all the blogs—even ones for different Transport-Level Errors—without success. To get back to a functioning condition, I undid package updates for my references. Nothing!

The Approach: Microsoft SQL Server 2014 SP1 Security Update (KB3070446) was the offender! When I uninstalled this update, everything worked flawlessly.

I wasted two days of development time trying to solve this issue; hopefully my post will spare someone else the pain!



Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow