<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://www2.sqlblog.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Why Am I Blocked? (A Month of Activity Monitoring, Part 19 of 30)</title><link>http://www2.sqlblog.com/blogs/adam_machanic/archive/2011/04/19/why-am-i-blocked-a-month-of-activity-monitoring-part-19-of-30.aspx</link><description>This post is part 19 of a 30-part series about the Who is Active stored procedure. A new post will run each day during the month of April, 2011. After April all of these posts will be edited and combined into a single document to become the basis of the</description><dc:language>en</dc:language><generator>CommunityServer 2.1 SP2 (Build: 61129.1)</generator><item><title>The Node Knows (A Month of Activity Monitoring, Part 20 of 30)</title><link>http://www2.sqlblog.com/blogs/adam_machanic/archive/2011/04/19/why-am-i-blocked-a-month-of-activity-monitoring-part-19-of-30.aspx#35047</link><pubDate>Wed, 20 Apr 2011 14:32:09 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:35047</guid><dc:creator>Adam Machanic</dc:creator><description>&lt;p&gt;This post is part 20 of a 30-part series about the Who is Active stored procedure. A new post will run&lt;/p&gt;
</description></item><item><title>The Key to Your Locks (A Month of Activity Monitoring, Part 22 of 30)</title><link>http://www2.sqlblog.com/blogs/adam_machanic/archive/2011/04/19/why-am-i-blocked-a-month-of-activity-monitoring-part-19-of-30.aspx#35108</link><pubDate>Fri, 22 Apr 2011 20:31:51 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:35108</guid><dc:creator>Adam Machanic</dc:creator><description>&lt;p&gt;This post is part 22 of a 30-part series about the Who is Active stored procedure. A new post will run&lt;/p&gt;
</description></item><item><title>Twenty Nine Days of Activity Monitoring (A Month of Activity Monitoring, Part 30 of 30)</title><link>http://www2.sqlblog.com/blogs/adam_machanic/archive/2011/04/19/why-am-i-blocked-a-month-of-activity-monitoring-part-19-of-30.aspx#35347</link><pubDate>Sat, 30 Apr 2011 15:45:16 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:35347</guid><dc:creator>Adam Machanic</dc:creator><description>&lt;p&gt;This post is part 30 of a 30-part series about the Who is Active stored procedure. A new post will run&lt;/p&gt;
</description></item><item><title>re: Why Am I Blocked? (A Month of Activity Monitoring, Part 19 of 30)</title><link>http://www2.sqlblog.com/blogs/adam_machanic/archive/2011/04/19/why-am-i-blocked-a-month-of-activity-monitoring-part-19-of-30.aspx#35994</link><pubDate>Tue, 31 May 2011 17:24:15 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:35994</guid><dc:creator>IJeb Reitsma</dc:creator><description>&lt;p&gt;Thanks for these series of high quality posts.&lt;/p&gt;
&lt;p&gt;This very usefull feature is somewhat hidden, although it is very well documented. I tried to find out why the first query of post 17 was blocked by the following query of post 14 and the first one was not.&lt;/p&gt;
&lt;p&gt;UPDATE TOP(10) Sales.SalesOrderDetail SET OrderQty += 7&lt;/p&gt;
&lt;p&gt;I expected it to see together with the locking information, but this only shows the GRANTED locks, not the locks with status WAIT.&lt;/p&gt;
&lt;p&gt;In the case of a keylock I also miss information about the actual record(s) that cause the blocking.&lt;/p&gt;
</description></item><item><title>re: Why Am I Blocked? (A Month of Activity Monitoring, Part 19 of 30)</title><link>http://www2.sqlblog.com/blogs/adam_machanic/archive/2011/04/19/why-am-i-blocked-a-month-of-activity-monitoring-part-19-of-30.aspx#35999</link><pubDate>Tue, 31 May 2011 21:15:45 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:35999</guid><dc:creator>IJeb Reitsma</dc:creator><description>&lt;p&gt;Sorry for my previous post. After going to post 22 I noticed that the locks xml also shows locks with request status &amp;quot;WAIT&amp;quot;.&lt;/p&gt;
</description></item><item><title>re: Why Am I Blocked? (A Month of Activity Monitoring, Part 19 of 30)</title><link>http://www2.sqlblog.com/blogs/adam_machanic/archive/2011/04/19/why-am-i-blocked-a-month-of-activity-monitoring-part-19-of-30.aspx#36000</link><pubDate>Tue, 31 May 2011 21:32:17 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:36000</guid><dc:creator>Adam Machanic</dc:creator><description>&lt;p&gt;Hi Ijeb,&lt;/p&gt;
&lt;p&gt;Glad to hear that it worked out! Enjoy using Who is Active :-)&lt;/p&gt;
&lt;p&gt;--Adam&lt;/p&gt;
</description></item><item><title>re: Why Am I Blocked? (A Month of Activity Monitoring, Part 19 of 30)</title><link>http://www2.sqlblog.com/blogs/adam_machanic/archive/2011/04/19/why-am-i-blocked-a-month-of-activity-monitoring-part-19-of-30.aspx#44379</link><pubDate>Thu, 19 Jul 2012 23:52:10 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:44379</guid><dc:creator>Gilles</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Have used the dbo.sp_WhoIsActive&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;@get_locks=1,&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;@get_additional_info = 1&lt;/p&gt;
&lt;p&gt;to find out why one of my session was blocked by another one.&lt;/p&gt;
&lt;p&gt;i actually run the following:&lt;/p&gt;
&lt;p&gt;WHILE (1=1)&lt;/p&gt;
&lt;p&gt;BEGIN&lt;/p&gt;
&lt;p&gt;	EXEC dbo.sp_WhoIsActive&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;@get_plans=1,&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;@get_locks=1,&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;@get_additional_info = 1&lt;/p&gt;
&lt;p&gt;	WAITFOR DELAY '00:00:01' &lt;/p&gt;
&lt;p&gt;END&lt;/p&gt;
&lt;p&gt;and as expected i obtained the following results:&lt;/p&gt;
&lt;p&gt;session 52 has a blocking session 53 (for multiple 10 of seconds) BUT when i look at the additional_info XML column for the blocked session 52 i do not see any 'block_info' node. It just tells me that the transaction_isolation_level is 'Serializable' and the command_type is 'UPDATE'.&lt;/p&gt;
&lt;p&gt;If i look at the locks XML column for the blocked session 52, i see only 'GRANT' locks, not a single 'WAIT' one...&lt;/p&gt;
&lt;p&gt;I was expecting to have at least one WAIT lock to explain why I am blocking for multiple seconds.&lt;/p&gt;
&lt;p&gt;I should add that if i change the application code to not require the session 52 to be using the Serializable isolation mode and downgrade it to 'ReadCommitted', no long blocking is experienced.&lt;/p&gt;
&lt;p&gt;Am sure am missing or not understanding something here. Do you have a suggestion?&lt;/p&gt;
&lt;p&gt;Thank you.&lt;/p&gt;
&lt;p&gt;Gilles.&lt;/p&gt;
</description></item><item><title>re: Why Am I Blocked? (A Month of Activity Monitoring, Part 19 of 30)</title><link>http://www2.sqlblog.com/blogs/adam_machanic/archive/2011/04/19/why-am-i-blocked-a-month-of-activity-monitoring-part-19-of-30.aspx#44380</link><pubDate>Fri, 20 Jul 2012 00:06:06 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:44380</guid><dc:creator>Gilles</dc:creator><description>&lt;p&gt;actually i had forgotten to use the @get_task_info=2, it now shows a &amp;lt;block_info&amp;gt; XML node with a keylock lock_type. Should i conclude that because the blocked session 52 is using a Serializable isolation mode, it is blocking as a single row lock has been put by session 53...then still why can't we see some WAIT locks in the lock column?&lt;/p&gt;
&lt;p&gt;Thanks again.&lt;/p&gt;
&lt;p&gt;Gilles&lt;/p&gt;
</description></item></channel></rss>