none
SQL Exception RRS feed

  • Question

  • I am receiving an exception trying to contact a SQL Azure database from a Windows Azure instance:

    A transport-level error has occurred when sending the request to the server. (provider: TCP Provider, error: 0 - An established connection was aborted by the software in your host machine.)

    What causes this issue? Is it an error I should expect to go away if I retry the request?

    thanks,

    Jane

    Wednesday, September 29, 2010 1:30 PM

Answers

  • Hello janec,

    It is very often that you will see that kind of error. Most of the time it is caused by a connection being idle more than 5 minutes in the Connection Pool of ADO.NET. SQL Azure will drop connections that are being idle more than 5 minutes (or 8 I guess, anyway), which is less than the default setting for ADO.NET connection pool for resetting connections. If you encounter such error you should include a retry logic to retry the operation. You can check out following posts on connection issues and connection retry logic:

    http://blogs.msdn.com/b/sqlazure/archive/2010/05/11/10011247.aspx

    http://blogs.msdn.com/b/bartr/archive/2010/06/18/sql-azure-connection-retry.aspx?utm_source=feedburner&utm_medium=twitter&utm_campaign=Feed%3A+SiteHome+%28Microsoft+|+Blog+|+MSDN%29

    Hope this helps!

    Wednesday, September 29, 2010 2:42 PM

All replies

  • Hello janec,

    It is very often that you will see that kind of error. Most of the time it is caused by a connection being idle more than 5 minutes in the Connection Pool of ADO.NET. SQL Azure will drop connections that are being idle more than 5 minutes (or 8 I guess, anyway), which is less than the default setting for ADO.NET connection pool for resetting connections. If you encounter such error you should include a retry logic to retry the operation. You can check out following posts on connection issues and connection retry logic:

    http://blogs.msdn.com/b/sqlazure/archive/2010/05/11/10011247.aspx

    http://blogs.msdn.com/b/bartr/archive/2010/06/18/sql-azure-connection-retry.aspx?utm_source=feedburner&utm_medium=twitter&utm_campaign=Feed%3A+SiteHome+%28Microsoft+|+Blog+|+MSDN%29

    Hope this helps!

    Wednesday, September 29, 2010 2:42 PM
  • Thanks!

    Wednesday, September 29, 2010 5:18 PM
  • Jane,

    Connections do get dropped if it is idle. Also, your connection can be throttled if your server is overloaded (too high CPU utilization or too many connection). So, I will check if you have too many opened connections (forgot to close them?). Otherwise, you will need to implement a retry policy.

     


    Thanks, Scott Ma. Schlumberger IT & Software Community Leader/MS SME for Entity Framework and Windows Azure Platform.
    Wednesday, September 29, 2010 5:26 PM