Sunday, April 3, 2011

Connection timeout

Hi Guys,

Im getting this error:

Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding

"Data Source=" + server + ";Initial Catalog=" + database + ";Integrated Security=SSPI;Connection Reset=False;"

Connection pooling is default to true and I am closing all connections.

Any ideas?

Cheers

PJ

From stackoverflow
  • Try setting ConnectionTimeout and/or CommandTimeout (if working on .NET). A timeout of 0 means "no timeout"

  • Is this problem occuring on only one page? or is it a global issue?

    Are you aware of what query is causing the timeout?

    • If not, you should add try/catches around your database calls and log your errors to determine where it is.
    • If so, can you run that query from your database tool? (IE SQL Server Management Studio)
      • Does your query succeed? or does it timeout?
      • Does it take a long time? Can you improve the performance of that query?
    Joel Coehoorn : are we even sure it's a page? could be winforms or something else entirely.
    Nathan Koop : not sure, I just left a comment to clarify, I mean to determine if it's only one query as opposed to the actual connection.
  • Could be that the SQL server does not allow incoming TCP/IP connections (which is the default setting).

  • I forgot to add this:

    This query is run several thousand times a day and this occurs sometimes.

0 comments:

Post a Comment