ConnectionTimeout vs. CommandTimeout

I was asked the question today why a sql query was timing out.  A co-worker explained that he changed the ConnectionTimeout setting and it was still timing out.  I thought i’d post about the differences between CommandTimeout and ConnectionTimeout.

ConnectionTimeout is the one specified in your connection string and it is the time it takes for a connection.Open() invocation to wait until it gets a connection reference from the connection pool.  (Default value is 15 seconds)

CommandTimeout is the maximum time for a specific sql command to execute.  (Default value is 30 seconds)

You can leave a response, or trackback from your own site.

Leave a Reply