<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: The sp_getapplock secret</title>
	<atom:link href="http://clay.lenharts.net/blog/2008/01/28/the-sp_getapplock-secret/feed/" rel="self" type="application/rss+xml" />
	<link>http://clay.lenharts.net/blog/2008/01/28/the-sp_getapplock-secret/</link>
	<description>A blog on .Net and SQL Server</description>
	<lastBuildDate>Tue, 31 Jan 2012 14:44:35 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Greg Martin</title>
		<link>http://clay.lenharts.net/blog/2008/01/28/the-sp_getapplock-secret/comment-page-1/#comment-15586</link>
		<dc:creator>Greg Martin</dc:creator>
		<pubDate>Thu, 09 Dec 2010 06:20:03 +0000</pubDate>
		<guid isPermaLink="false">http://clay.lenharts.net/blog/2008/01/28/the-sp_getapplock-secret/#comment-15586</guid>
		<description>Clay,

I think Yair meant you didn&#039;t call sp_releaseapplock() after the COMMIT which might appear necessary at first glance at sp_getapplock().

The reason it&#039;s not is that an applock has by default transaction scope and is released automatically when the transaction is committed or rolled back.

Had your code included the parameter @LockOwner=&#039;Session&#039; then you would have had to explicitly call sp_releaseapplock().

Greg</description>
		<content:encoded><![CDATA[<p>Clay,</p>
<p>I think Yair meant you didn&#8217;t call sp_releaseapplock() after the COMMIT which might appear necessary at first glance at sp_getapplock().</p>
<p>The reason it&#8217;s not is that an applock has by default transaction scope and is released automatically when the transaction is committed or rolled back.</p>
<p>Had your code included the parameter @LockOwner=&#8217;Session&#8217; then you would have had to explicitly call sp_releaseapplock().</p>
<p>Greg</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: rob towne</title>
		<link>http://clay.lenharts.net/blog/2008/01/28/the-sp_getapplock-secret/comment-page-1/#comment-15454</link>
		<dc:creator>rob towne</dc:creator>
		<pubDate>Mon, 28 Jun 2010 21:10:37 +0000</pubDate>
		<guid isPermaLink="false">http://clay.lenharts.net/blog/2008/01/28/the-sp_getapplock-secret/#comment-15454</guid>
		<description>Clay, huge props, man.
I was needing something just like this and have been going crazy trying some different workarounds. Thanks so much for sharing this..

Robert</description>
		<content:encoded><![CDATA[<p>Clay, huge props, man.<br />
I was needing something just like this and have been going crazy trying some different workarounds. Thanks so much for sharing this..</p>
<p>Robert</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Clay Lenhart</title>
		<link>http://clay.lenharts.net/blog/2008/01/28/the-sp_getapplock-secret/comment-page-1/#comment-15407</link>
		<dc:creator>Clay Lenhart</dc:creator>
		<pubDate>Mon, 08 Mar 2010 22:03:45 +0000</pubDate>
		<guid isPermaLink="false">http://clay.lenharts.net/blog/2008/01/28/the-sp_getapplock-secret/#comment-15407</guid>
		<description>Yair,  I&#039;m not sure how to answer your question.  You could say that &quot;releasing&quot; the transaction is the same thing as &quot;committing&quot; the transaction.

The way transactions work, &quot;BEGIN TRAN&quot; is committed with &quot;COMMIT TRAN&quot;.

Let me know if this doesn&#039;t answer your question.</description>
		<content:encoded><![CDATA[<p>Yair,  I&#8217;m not sure how to answer your question.  You could say that &#8220;releasing&#8221; the transaction is the same thing as &#8220;committing&#8221; the transaction.</p>
<p>The way transactions work, &#8220;BEGIN TRAN&#8221; is committed with &#8220;COMMIT TRAN&#8221;.</p>
<p>Let me know if this doesn&#8217;t answer your question.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Yair</title>
		<link>http://clay.lenharts.net/blog/2008/01/28/the-sp_getapplock-secret/comment-page-1/#comment-15404</link>
		<dc:creator>Yair</dc:creator>
		<pubDate>Fri, 05 Mar 2010 14:47:04 +0000</pubDate>
		<guid isPermaLink="false">http://clay.lenharts.net/blog/2008/01/28/the-sp_getapplock-secret/#comment-15404</guid>
		<description>Hi,

Why don&#039;t you release the transaction after the commit?

Yair</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>Why don&#8217;t you release the transaction after the commit?</p>
<p>Yair</p>
]]></content:encoded>
	</item>
</channel>
</rss>

