Unstable connection? 'Physical connection is not usable'

Hello,

we are experiencing this exception while connecting to SQL Azure database.

System.Data.SqlClient.SqlException: A transport-level error has occurred when receiving results from the server. (provider: Session Provider, error: 19 - Physical connection is not usable)

This exception  is popping up irregularly. Sometimes we have 2-3 days without them, sometimes we get 2-3 exceptions during one day.

We were getting set of exceptions before. But then we changed EntityFramework to version 6 and added SqlAzureExceptionStrategy. This helps us out, but the 'Physical connection is not usable'Exception is persistent.

We can implement our own ExecutionStrategy based on SqlAzureExecutionStrategy and add these exception to support retry logic.

But is it the right solution in this case? And why isn't this exception implemented by default SqlAzureExecutionStrategy?

I'll be glad for any answer.

===

Edited - semaphore timeout exception has nothing to do with this topic


June 9th, 2014 10:37am

Hello,

SqlAzureExecutionStrategy will retry the operation on TimeoutException and SqlException if the Errors contains any of the following error numbers: 40613, 40501, 40197, 10929, 10928, 10060, 10054, 10053, 233, 64 and 20. You can refer to the SqlAzureRetriableExceptionDetector about the details about this errors. The SqlException (error 19)you received is not in the SqlAzureRetriableExceptionDetector.

The SqlException may be caused by the connection pool. For example. A connection is taken from the connection pool, the application does not know that the physical connection is gone, an attempt to use it is done under the assumption that the physical connection is still there. If so, you can try to using the ClearPool method to clears the connection pool that is associated with the connection.

Reference:http://forums.asp.net/t/1987392.aspx?Error+accessing+database+Entity+Framework+A+transport+level+error+has+occurred+when+receiving+results+from+the+server+provider+Session+Provider+error+19+Physical+connection+is+not+usable+

Regards,
Fann

Free Windows Admin Tool Kit Click here and download it now
June 11th, 2014 5:32am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics