Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What causes this SqlException: A transport-level error has occurred when receiving results from the server

Here is the full error: SqlException: A transport-level error has occurred when receiving results from the server. (provider: Shared Memory Provider, error: 1 - I/O Error detected in read/write operation)

I've started seeing this message intermittently for a few of the unit tests in my application (there are over 1100 unit & system tests). I'm using the test runner in ReSharper 4.1.

One other thing: my development machine is a VMWare virtual machine.

like image 860
Scott Lawrence Avatar asked Sep 09 '08 19:09

Scott Lawrence


3 Answers

I ran into this many moons ago. Bottom line is you are running out of available ports.

First make sure your calling application has connection pooling on.

If that does then check the number of available ports for the SQL Server.

What is happening is that if pooling is off then every call takes a port and it takes by default 4 minutes to have the port expire, and you are running out of ports.

If pooling is on then you need to profile all the ports of SQL Server and make sure you have enough and expand them if necessary.

When I came across this error, connection pooling was off and it caused this issue whenever a decent load was put on the website. We did not see it in development because the load was 2 or 3 people at max, but once the number grew over 10 we kept seeing this error. We turned pooling on, and it fixed it.

like image 134
David Basarab Avatar answered Oct 25 '22 20:10

David Basarab


I ran into this many moons ago as well. However, not to discount @Longhorn213s explanation, but we had the exact opposite behavior. We received the error in development and testing, but not production where obviously the load was much greater. We ended up tolerating the issue in development as it was sporadic and didn't materially slow down progress. I think there could be several reasons for this error, but was never able to pin point the cause myself.

like image 32
JasonS Avatar answered Oct 25 '22 20:10

JasonS


We've also run across this error and figured out that we were killing a SQL server connection from the database server. The client application is under the impression that the connection is still active and tries make use of that connection, but fails because it was terminated.

like image 45
Sir Rippov the Maple Avatar answered Oct 25 '22 20:10

Sir Rippov the Maple