none
SQL AZURE connection time out problem

    Question

  • Hi!

    I am getting following error while using SQL Azure from WCF services hosted on windows azure

    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.)  

    This error also doesn't come always. However I get this at least couple of times in an hour  while using the service

    Any idea why the server might be rejecting the connection?

    Regards
    Prasad

    Wednesday, September 30, 2009 2:55 PM

Answers

  • Prasad,

    A connection can be cut off by the server for a number of reasons:

    1. Idle connection longer than 5 minutes.
    2. Long running query.
    3. Long running open transaction.
    4. Excessive resource usage.

    Idle connection timeout could be due to transient load when using connection pooling (on by default), since the pool times out idle connections after 10 minutes and SQL Azure times them out on the server-side in 5 minutes. In certain circumstances you could get a new connection from the pool that has been closed by the server.

    Thanks.

    Malcolm Stewart - MSFT
    Wednesday, September 30, 2009 3:15 PM

All replies

  • Prasad,

    A connection can be cut off by the server for a number of reasons:

    1. Idle connection longer than 5 minutes.
    2. Long running query.
    3. Long running open transaction.
    4. Excessive resource usage.

    Idle connection timeout could be due to transient load when using connection pooling (on by default), since the pool times out idle connections after 10 minutes and SQL Azure times them out on the server-side in 5 minutes. In certain circumstances you could get a new connection from the pool that has been closed by the server.

    Thanks.

    Malcolm Stewart - MSFT
    Wednesday, September 30, 2009 3:15 PM
  • Mi Malcolm,

    Thanks. I have just ported an already running WCF code from hosted server to Azure environment. I have never got this error on our hosting environment.

    Inside the WCF code I am just opening a SQL connection

    selecting a record from a table

    The select is based on primary key and always return a value - 1 or 0. I am using executescaler to check existance of a value in a table

    then Inserting a record

    and closing the connection

    I have just changed the connection string from our existing SQL server to Azure DB connection string.

    This issue also doesn't come always. I will anyway re look at my code

    Regards
    Prasad
    Thursday, October 01, 2009 9:40 AM