Finding Locals In CLR

Today I’m looking at a few Watson dumps trying to determine why SqlConnection is failing to connect to SQL Server and hanging. I see stack like below: 0:000> k 0021dc5c 79f40778 kernel32!SleepEx+0x62 0021dc90 7a0561d7 mscorwks!EESleepEx+0xa3 0021dc9c 7a12fc71 mscorwks!CExecutionEngine::ClrSleepEx+0xd 0021dcac 7a0e4d7c mscorwks!ClrSleepEx+0x13 0021dce8 7a082a5f mscorwks!Thread::UserSleep+0x63 0021dd88 652e94cd mscorwks!ThreadNative::Sleep+0xce 0021ddc8 652e9283 System_Data_ni!System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover 0021de20 652e83ff System_Data_ni!System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist   I…

0

Connection Pooling, ADO.NET, SPIDs

If you have pooling issues with ADO.NET (leaking connections, pool size exceeded, etc…) one way to slice and dice these with SQL 2005 is to use the SQL 2005 system DMVs.   You can locate leaked connections like so:   select session_id, datediff(s,last_read,getdate()) as SecondsSinceLastRead, datediff(s,last_write,getdate()) as SecondsSinceLastWrite, (select text from sys.dm_exec_sql_text(dec.most_recent_sql_handle)) as LastSqlStatment from…

2