We are having legacy SOAP ASP.NET webservice, which connects to SQL Server database to retrieve resultset. Below is our connection string:
connectionString="server=ServerName;database=UserDBName;user id=UserNameRef;Password=myPassword;
We have command timeout set as 5 minutes. What we see is, we are getting frequent timeout issue errors happening for our SQL Server 2012 database with connection pooling. There are no major activities going on in the server or blocking issues happening.
PFB snapshot from sp_whoisactive
tracing. If we see, the session 52 is getting time out after 5 minutes. We are not running any command in this session. Don't know, why it suddenly getting timing out.
How to fix these timeout errors ?
+---------+------------+-----------+----------+---------------------------+-------------+---------------------+-------------+------------+------------+-----------------+
| status | session_id | wait_info | sql_text | sql_command | login_name | blocking_session_id | host_name | start_time | login_time | collection_time |
+---------+------------+-----------+----------+---------------------------+-------------+---------------------+-------------+------------+------------+-----------------+
| dormant | 52 | NULL | | sys.sp_reset_connection;1 | UserNameRef | NULL | HostNameRef | 2:39:00 AM | 2:39:00 AM | 2:39:00 AM |
| dormant | 52 | NULL | | sys.sp_reset_connection;1 | UserNameRef | NULL | HostNameRef | 2:39:06 AM | 2:39:00 AM | 2:39:16 AM |
| dormant | 52 | NULL | | sys.sp_reset_connection;1 | UserNameRef | NULL | HostNameRef | 2:39:21 AM | 2:39:00 AM | 2:39:31 AM |
| dormant | 52 | NULL | | sys.sp_reset_connection;1 | UserNameRef | NULL | HostNameRef | 2:39:21 AM | 2:39:00 AM | 2:39:46 AM |
| dormant | 52 | NULL | | sys.sp_reset_connection;1 | UserNameRef | NULL | HostNameRef | 2:39:21 AM | 2:39:00 AM | 2:40:01 AM |
| dormant | 52 | NULL | | sys.sp_reset_connection;1 | UserNameRef | NULL | HostNameRef | 2:39:21 AM | 2:39:00 AM | 2:40:16 AM |
| dormant | 52 | NULL | | sys.sp_reset_connection;1 | UserNameRef | NULL | HostNameRef | 2:39:21 AM | 2:39:00 AM | 2:40:31 AM |
| dormant | 52 | NULL | | sys.sp_reset_connection;1 | UserNameRef | NULL | HostNameRef | 2:39:21 AM | 2:39:00 AM | 2:40:46 AM |
| dormant | 52 | NULL | | sys.sp_reset_connection;1 | UserNameRef | NULL | HostNameRef | 2:39:21 AM | 2:39:00 AM | 2:41:01 AM |
| dormant | 52 | NULL | | sys.sp_reset_connection;1 | UserNameRef | NULL | HostNameRef | 2:39:21 AM | 2:39:00 AM | 2:41:16 AM |
| dormant | 52 | NULL | | sys.sp_reset_connection;1 | UserNameRef | NULL | HostNameRef | 2:39:21 AM | 2:39:00 AM | 2:41:31 AM |
| dormant | 52 | NULL | | sys.sp_reset_connection;1 | UserNameRef | NULL | HostNameRef | 2:39:21 AM | 2:39:00 AM | 2:41:46 AM |
| dormant | 52 | NULL | | sys.sp_reset_connection;1 | UserNameRef | NULL | HostNameRef | 2:39:21 AM | 2:39:00 AM | 2:42:01 AM |
| dormant | 52 | NULL | | sys.sp_reset_connection;1 | UserNameRef | NULL | HostNameRef | 2:39:21 AM | 2:39:00 AM | 2:42:16 AM |
| dormant | 52 | NULL | | sys.sp_reset_connection;1 | UserNameRef | NULL | HostNameRef | 2:39:21 AM | 2:39:00 AM | 2:42:31 AM |
| dormant | 52 | NULL | | sys.sp_reset_connection;1 | UserNameRef | NULL | HostNameRef | 2:39:21 AM | 2:39:00 AM | 2:42:46 AM |
| dormant | 52 | NULL | | sys.sp_reset_connection;1 | UserNameRef | NULL | HostNameRef | 2:39:21 AM | 2:39:00 AM | 2:43:01 AM |
| dormant | 52 | NULL | | sys.sp_reset_connection;1 | UserNameRef | NULL | HostNameRef | 2:39:21 AM | 2:39:00 AM | 2:43:16 AM |
| dormant | 52 | NULL | | sys.sp_reset_connection;1 | UserNameRef | NULL | HostNameRef | 2:39:21 AM | 2:39:00 AM | 2:43:30 AM |
| dormant | 52 | NULL | | sys.sp_reset_connection;1 | UserNameRef | NULL | HostNameRef | 2:39:21 AM | 2:39:00 AM | 2:43:46 AM |
| dormant | 52 | NULL | | sys.sp_reset_connection;1 | UserNameRef | NULL | HostNameRef | 2:39:21 AM | 2:39:00 AM | 2:44:01 AM | <== Post this timeout occurs
+---------+------------+-----------+----------+---------------------------+-------------+---------------------+-------------+------------+------------+-----------------+