Saturday, August 30, 2008

SQL Server SQLClient Timeouts 101 - Everything you’ve wanted to know about SQLClient Timeouts that can be covered in a few pages or less

Tone Poem - SqlClient Timeouts Revealed

“SqlClient.  First a classification of where timeouts can occur with SqlClient:

  1. When attempting to get a connection from the SqlClient connection pool
  2. When attempting to create a new fresh connection to server (not getting one from pool)
  3. When sending a command explicitly to the server
  4. When sending commands with "context connection=true"
  5. When sending commands implicitly (under the covers) to the server
  6. When executing asynchronous commands (BeginExecute...)
  7. When waiting for attention acknowledgement from server (special rare case)
  8. When sending TM commands
  9. When fetching rows
  10. When uploading rows using bulk copy

Login Timeouts

Explicit Command Execution Timeouts

SqlConnection and "context connection=true"

Implicit Command Timeouts

Asynchronous Command Execution Timeout

Cancel Timeout (attention acknowledgement timeout)

…”

How async command execution timeouts are handled (or not) was news to me. Learning more every day…

No comments: