<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/xsl" href="RSS_xslt_style.asp" version="1.0" ?>
<rss version="2.0" xmlns:WebWizForums="http://syndication.webwiz.co.uk/rss_namespace/">
 <channel>
  <title>DevForce Community Forum : Implementing [NOLOCK]</title>
  <link>http://www.ideablade.com/forum/</link>
  <description>This is an XML content feed of; DevForce Community Forum : DevForce Classic : Implementing [NOLOCK]</description>
  <pubDate>Thu, 21 May 2026 18:55:01 -700</pubDate>
  <lastBuildDate>Thu, 12 Jul 2007 16:08:18 -700</lastBuildDate>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>Web Wiz Forums 9.69</generator>
  <ttl>360</ttl>
  <WebWizForums:feedURL>www.ideablade.com/forum/RSS_post_feed.asp?TID=221</WebWizForums:feedURL>
  <image>
   <title>DevForce Community Forum</title>
   <url>http://www.ideablade.com/forum/forum_images/IdeaBlade_logo_tm.png</url>
   <link>http://www.ideablade.com/forum/</link>
  </image>
  <item>
   <title>Implementing [NOLOCK] : You&amp;#039;re right, I looked that...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=221&amp;PID=488#488</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=21" rel="nofollow">IdeaBlade</a><br /><strong>Subject:</strong> 221<br /><strong>Posted:</strong> 12-Jul-2007 at 4:08pm<br /><br /><DIV dir=ltr align=left><SPAN =343164121-01052007><FONT face=Arial color=#0000ff size=2>You're right, I looked that up quickly in SQL Server Help and didn't notice the SQL Server Mobile part.</FONT></SPAN></DIV><DIV dir=ltr align=left><SPAN =343164121-01052007><FONT face=Arial color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV><DIV dir=ltr align=left><SPAN =343164121-01052007><FONT face=Arial color=#0000ff size=2>In any event, your mechanism for influencing DevForce's locking behavior on queries is the one I previously described: setting the IsolationLevel in the TransactionSettings parameter of a QueryStrategy.&nbsp; However, I happened to discuss some of this with Albert Wang and Jay Traband, both of whom are somewhat familiar with the history of your company's app, and they both expressed doubt that any deviation from the default locking behavior is really necessary.&nbsp; Apparently there were some performance issues at one point with the Broadlane app that were ultimately addressed by the effective use of data pre-fetch; and other performance problems that were addressed by turning off query inversion in certain queries involving subqueries, where the subqueries caused a great deal of subordinate data to be downloaded. </FONT></SPAN><SPAN =343164121-01052007><FONT face=Arial color=#0000ff size=2><SPAN =343164121-01052007><FONT face=Arial color=#0000ff size=2>We think the NOLOCK queries may have been tried before the actual problems were completely understood, and that they aren't needed. </FONT></SPAN><SPAN =343164121-01052007><FONT face=Arial color=#0000ff size=2>It seems likely that you can replace them with ordinary EntityQueries or RdbQueries, using the default settings, and suffer no perceptible negative consequences.</FONT></SPAN></DIV></FONT></SPAN>]]>
   </description>
   <pubDate>Thu, 12 Jul 2007 16:08:18 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=221&amp;PID=488#488</guid>
  </item> 
  <item>
   <title>Implementing [NOLOCK] : Per SQL server documentation,...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=221&amp;PID=487#487</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=20" rel="nofollow">Customer</a><br /><strong>Subject:</strong> 221<br /><strong>Posted:</strong> 12-Jul-2007 at 4:07pm<br /><br /><P =Ms&#111;normal><FONT face=Arial color=navy><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"><FONT size=3>Per SQL server documentation, SQL Server operates with READCOMMITTED as the default isolation level, and thus for selects default is LOCK. The statement you have provided applies to SQL Server 2005 Compact edition and is different for SQL Server 2005.<?:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></FONT></SPAN></FONT></P><P =Ms&#111;normal><FONT size=3><FONT color=navy><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">Here is the documentation note from SQL Server books online: (</SPAN></FONT><FONT face=Arial color=navy><SPAN style="FONT-SIZE: 7.5pt; COLOR: navy; FONT-FAMILY: Arial"><a href="http://msdn2.microsoft.com/en-us/library/ms171885.aspx" target="_blank">http://msdn2.microsoft.com/en-us/library/ms171885.aspx</A></SPAN></FONT><FONT color=navy><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">) <o:p></o:p></SPAN></FONT></FONT></P><P =Ms&#111;normal><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 8pt">Although the default isolation level in SQL Server Compact Edition is Read Committed, using this isolation level does not result in S locks being taken when data is read. This behavior is unlike Microsoft SQL Server<FONT color=blue><SPAN style="COLOR: blue">. In SQL Server, when using Read Committed (</SPAN></FONT><FONT color=#3366ff><SPAN style="COLOR: #3366ff">the default is ‘READCOMMITED’</SPAN></FONT><FONT color=blue><SPAN style="COLOR: blue">)</SPAN></FONT>, an S lock is requested whenever a row is read, and this will wait if there is a conflicting lock on that row. SQL Server Compact Edition does not require an S lock because versions of data pages are automatically maintained to ensure that committed data can be read without the need to take a lock. This is important because, in SQL Server Compact Edition, SELECT operations do not need to take any locks on the data and almost always succeed. SELECT operations will not wait if some data has an X lock, as opposed to SQL Server. The SELECT operation still requires a Sch-S lock. The operation will fail only if the table is being modified, because a conflicting Sch-X lock will exist.</SPAN></FONT><FONT face=Arial color=navy><SPAN style="FONT-SIZE: 8pt; COLOR: navy; FONT-FAMILY: Arial"><o:p></o:p></SPAN></FONT></P><P =Ms&#111;normal><FONT face=Arial color=navy size=3><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"><o:p></o:p></SPAN></FONT></P><P =Ms&#111;normal><FONT size=3><FONT face=Arial color=navy><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">So, with the above statement, NOLOCK is not the default behavior/setting for SQL SERVER 2005 and that needs to be set manually. Earlier we used to convert RdbQuery to PassThruRdbQuery and replace the string to set NOLOCK (for e.g., </SPAN></FONT><FONT face=Arial><SPAN style="FONT-SIZE: 8pt; FONT-FAMILY: Arial">pPassthruRdbQuery.SqlSelect = pPassthruRdbQuery.SqlSelect.Replace("from \"dbo\".\"&lt;TABLE_NAME&gt;\"", "from \"dbo\".\"&lt;TABLE_NAME&gt;\" (NOLOCK)");</SPAN></FONT><FONT face="Courier New"><SPAN style="FONT-SIZE: 8pt; FONT-FAMILY: 'Courier New'">)</SPAN></FONT><FONT face=Arial color=navy><SPAN style="FONT-SIZE: 8pt; COLOR: navy; FONT-FAMILY: Arial"> <o:p></o:p></SPAN></FONT></FONT></P><P =Ms&#111;normal><FONT face=Arial color=navy size=3><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"><o:p></o:p></SPAN></FONT></P><P =Ms&#111;normal><FONT face=Arial color=navy><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"><FONT size=3>Correct me if my analysis is incorrect or I miss something.<o:p></o:p></FONT></SPAN></FONT><BR></P>]]>
   </description>
   <pubDate>Thu, 12 Jul 2007 16:07:46 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=221&amp;PID=487#487</guid>
  </item> 
  <item>
   <title>Implementing [NOLOCK] : According to the SQL Server documentation:  ...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=221&amp;PID=486#486</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=21" rel="nofollow">IdeaBlade</a><br /><strong>Subject:</strong> 221<br /><strong>Posted:</strong> 12-Jul-2007 at 4:06pm<br /><br /><DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN =796411822-30042007>According to the SQL Server documentation:</SPAN></FONT></DIV><DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN =796411822-30042007></SPAN></FONT>&nbsp;</DIV><DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN =796411822-30042007>&nbsp;&nbsp;&nbsp; "NOLOCK does not issue any locks. This is the default for SELECT operations.&nbsp; It does not apply to INSERT, UPDATE, or DELETE statements"</SPAN></FONT></DIV><DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN =796411822-30042007></SPAN></FONT>&nbsp;</DIV><DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN =796411822-30042007>We do not change this default.</SPAN></FONT></DIV><DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN =796411822-30042007></SPAN></FONT>&nbsp;</DIV><DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN =796411822-30042007>You can control the isolation level of queries by setting the IsolationLevel property of the TransactionSettings parameter of a QueryStrategy or SaveOptions object. However, we recommend that you leave these settings at their defaults unless you have identified a specific problem with the default behavior.</SPAN></FONT></DIV><DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN =796411822-30042007></SPAN></FONT>&nbsp;</DIV>]]>
   </description>
   <pubDate>Thu, 12 Jul 2007 16:06:46 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=221&amp;PID=486#486</guid>
  </item> 
  <item>
   <title>Implementing [NOLOCK] : I am wondering if there is a way...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=221&amp;PID=485#485</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=20" rel="nofollow">Customer</a><br /><strong>Subject:</strong> 221<br /><strong>Posted:</strong> 12-Jul-2007 at 4:05pm<br /><br /><FONT size=2><FONT face=Arial>I am wondering if there is a way to set NOLOCK when querying database table. One way I know is using PassThruRdbQueries but I am using ORM generated entities to query and want to set NOLOCK at entities level instead of getting sql from the entities and manually setting NOLOCK.<?:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></FONT></FONT><P =Ms&#111;normal><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><o:p></o:p></SPAN></P><P =Ms&#111;normal><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Is there a way to accomplish this? I remember something you said in the training class but I couldn’t recall. I appreciate your response on this.<o:p></o:p></SPAN></P>]]>
   </description>
   <pubDate>Thu, 12 Jul 2007 16:05:59 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=221&amp;PID=485#485</guid>
  </item> 
 </channel>
</rss>