﻿<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>StrataFrame Forum » StrataFrame Application Framework - V1 » Business Objects and Data Access (How do I?)  » Locking Problem</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Tue, 09 Jun 2026 17:44:31 GMT</lastBuildDate><ttl>20</ttl><item><title>Locking Problem</title><link>http://forum.strataframe.net/FindPost3779.aspx</link><description>I have a problem with locking/timeouts within one of my business objects.&lt;/P&gt;&lt;P&gt;I have a routine in my ControlBO that gets the last transaction reference number, increments the value by one,&amp;nbsp;saves it and returns the value.&lt;/P&gt;&lt;P&gt;My posting routine makes a call for each record to my ControlBO.GetNextTransNumber to retrieve the next transaction number.&amp;nbsp;(By the way, I am using transaction processing).&lt;/P&gt;&lt;P&gt;Everything works perfectly if I only have one record to process, however if I have more than one record to process, I get a timeout on the FillDataTable command on the second record trying to get the next transaction number.&lt;/P&gt;&lt;P&gt;Any ideas on why this is happening?</description><pubDate>Mon, 23 Oct 2006 16:21:59 GMT</pubDate><dc:creator>Tim Dol</dc:creator></item><item><title>RE: Locking Problem</title><link>http://forum.strataframe.net/FindPost3821.aspx</link><description>That is exactly what happened to me.&amp;nbsp; The only way I could get my import routine to work was with the NOLOCK.&amp;nbsp; I don't know if this is the best way to do it but I couldn't find any other way to get it to work.&amp;nbsp; If you come up with some thing please let me know,&amp;nbsp; I will do the same.&lt;P&gt;Scott</description><pubDate>Mon, 23 Oct 2006 16:21:59 GMT</pubDate><dc:creator>Scott</dc:creator></item><item><title>RE: Locking Problem</title><link>http://forum.strataframe.net/FindPost3820.aspx</link><description>Thanks Scott, this solution worked fine, however I'm concerned if this is a work around or standard practice when implementing transactions.&amp;nbsp; Based on the information Ben supplied with respect to isolation levels, the ReadUncommitted should have worked...Actually I tried them all and none of them worked for repeated reads.&lt;/P&gt;&lt;P&gt;Right now I have a FillByItemNumber method in my InventoryBO. I use this anytime I want to retrieve an inventory record.&amp;nbsp; Does this mean I need to create another method FillByItemNumberNoLock and use this anytime I want to update the item muliple time within a transaction?&amp;nbsp;</description><pubDate>Mon, 23 Oct 2006 16:04:32 GMT</pubDate><dc:creator>Tim Dol</dc:creator></item><item><title>RE: Locking Problem</title><link>http://forum.strataframe.net/FindPost3810.aspx</link><description>I just wanted to make sure. :)</description><pubDate>Mon, 23 Oct 2006 14:44:34 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: Locking Problem</title><link>http://forum.strataframe.net/FindPost3808.aspx</link><description>No, the problem is on my local development machine.</description><pubDate>Mon, 23 Oct 2006 14:36:11 GMT</pubDate><dc:creator>Tim Dol</dc:creator></item><item><title>RE: Locking Problem</title><link>http://forum.strataframe.net/FindPost3803.aspx</link><description>Tim,&lt;/P&gt;&lt;P&gt;Are you running your assembly from a network drive in this scenario?&amp;nbsp; There could be some additional trust and policy issues.</description><pubDate>Mon, 23 Oct 2006 12:42:30 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: Locking Problem</title><link>http://forum.strataframe.net/FindPost3802.aspx</link><description>I ran into a similar situation,&amp;nbsp; look into using the &lt;BR&gt;&lt;FONT color=#800000 size=2&gt;&lt;P&gt;WITH (NOLOCK)&lt;/P&gt;&lt;/FONT&gt;clause, that did the trick for me.</description><pubDate>Mon, 23 Oct 2006 12:24:36 GMT</pubDate><dc:creator>Scott</dc:creator></item><item><title>RE: Locking Problem</title><link>http://forum.strataframe.net/FindPost3801.aspx</link><description>Nope, no other suggestions right now... but I'll keep thinking about it.</description><pubDate>Mon, 23 Oct 2006 11:44:38 GMT</pubDate><dc:creator>StrataFrame Team</dc:creator></item><item><title>RE: Locking Problem</title><link>http://forum.strataframe.net/FindPost3799.aspx</link><description>Changing the Isolation level to ReadUncommitted did not solve the problem. &amp;nbsp;The program works fine without transactions so I guess I will have to experiment unless you have any other suggestions.</description><pubDate>Mon, 23 Oct 2006 11:23:37 GMT</pubDate><dc:creator>Tim Dol</dc:creator></item><item><title>RE: Locking Problem</title><link>http://forum.strataframe.net/FindPost3795.aspx</link><description>I know for certain that the data access did not change from 1.4 to 1.5, and the transaction processing hasn't changed since 1.3... According to the documentation for ReadCommitted, SQL Server will use locks to prevent reading of uncommitted tables, you should probably use ReadUncommitted in this case.&amp;nbsp; From the .NET documentation:&lt;/P&gt;&lt;P&gt;&lt;TABLE cellSpacing=2 cellPadding=5 width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH&gt;&amp;nbsp;&lt;/TH&gt;&lt;TH align=left&gt;Member name&lt;/TH&gt;&lt;TH align=left&gt;Description&lt;/TH&gt;&lt;/TR&gt;&lt;TR vAlign=top&gt;&lt;TD&gt;&lt;IMG alt="Supported by the .NET Compact Framework" src="ms-help://MS.VSCC.v80/MS.MSDN.v80/MS.NETDEVFX.v20.en/cpref4/local/CFW.gif"&gt;&lt;/IMG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;B&gt;Chaos&lt;/B&gt;&lt;/TD&gt;&lt;TD&gt;The pending changes from more highly isolated transactions cannot be overwritten.&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR vAlign=top&gt;&lt;TD&gt;&lt;IMG alt="Supported by the .NET Compact Framework" src="ms-help://MS.VSCC.v80/MS.MSDN.v80/MS.NETDEVFX.v20.en/cpref4/local/CFW.gif"&gt;&lt;/IMG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;B&gt;ReadCommitted&lt;/B&gt;&lt;/TD&gt;&lt;TD&gt;Shared locks are held while the data is being read to avoid dirty reads, but the data can be changed before the end of the transaction, resulting in non-repeatable reads or phantom data.&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR vAlign=top&gt;&lt;TD&gt;&lt;IMG alt="Supported by the .NET Compact Framework" src="ms-help://MS.VSCC.v80/MS.MSDN.v80/MS.NETDEVFX.v20.en/cpref4/local/CFW.gif"&gt;&lt;/IMG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;B&gt;ReadUncommitted&lt;/B&gt;&lt;/TD&gt;&lt;TD&gt;A dirty read is possible, meaning that no shared locks are issued and no exclusive locks are honored.&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR vAlign=top&gt;&lt;TD&gt;&lt;IMG alt="Supported by the .NET Compact Framework" src="ms-help://MS.VSCC.v80/MS.MSDN.v80/MS.NETDEVFX.v20.en/cpref4/local/CFW.gif"&gt;&lt;/IMG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;B&gt;RepeatableRead&lt;/B&gt;&lt;/TD&gt;&lt;TD&gt;Locks are placed on all data that is used in a query, preventing other users from updating the data. Prevents non-repeatable reads but phantom rows are still possible.&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR vAlign=top&gt;&lt;TD&gt;&lt;IMG alt="Supported by the .NET Compact Framework" src="ms-help://MS.VSCC.v80/MS.MSDN.v80/MS.NETDEVFX.v20.en/cpref4/local/CFW.gif"&gt;&lt;/IMG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;B&gt;Serializable&lt;/B&gt;&lt;/TD&gt;&lt;TD&gt;A range lock is placed on the &lt;A href="ms-help://MS.VSCC.v80/MS.MSDN.v80/MS.NETDEVFX.v20.en/cpref4/html/T_System_Data_DataSet.htm"&gt;DataSet&lt;/A&gt;, preventing other users from updating or inserting rows into the dataset until the transaction is complete.&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR vAlign=top&gt;&lt;TD&gt;&lt;IMG alt="Supported by the .NET Compact Framework" src="ms-help://MS.VSCC.v80/MS.MSDN.v80/MS.NETDEVFX.v20.en/cpref4/local/CFW.gif"&gt;&lt;/IMG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;B&gt;Snapshot&lt;/B&gt;&lt;/TD&gt;&lt;TD&gt;Reduces blocking by storing a version of data that one application can read while another is modifying the same data. Indicates that from one transaction you cannot see changes made in other transactions, even if you requery.&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR vAlign=top&gt;&lt;TD&gt;&lt;IMG alt="Supported by the .NET Compact Framework" src="ms-help://MS.VSCC.v80/MS.MSDN.v80/MS.NETDEVFX.v20.en/cpref4/local/CFW.gif"&gt;&lt;/IMG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;B&gt;Unspecified&lt;/B&gt;&lt;/TD&gt;&lt;TD&gt;A different isolation level than the one specified is being used, but the level cannot be determined.&amp;nbsp; &lt;P&gt;When using &lt;A href="ms-help://MS.VSCC.v80/MS.MSDN.v80/MS.NETDEVFX.v20.en/cpref4/html/T_System_Data_Odbc_OdbcTransaction.htm"&gt;OdbcTransaction&lt;/A&gt;, if you do not set &lt;B&gt;IsolationLevel&lt;/B&gt; or you set &lt;B&gt;IsolationLevel&lt;/B&gt; to &lt;B&gt;Unspecied&lt;/B&gt;, the transaction executes according to the default isolation level of the underlying ODBC driver.&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description><pubDate>Mon, 23 Oct 2006 09:57:24 GMT</pubDate><dc:creator>StrataFrame Team</dc:creator></item><item><title>RE: Locking Problem</title><link>http://forum.strataframe.net/FindPost3794.aspx</link><description>I am using IsolationLevel.ReadCommitted.&amp;nbsp; Did something change in 1.5 because I'm fairly certain my code worked under 1.4?&lt;/P&gt;&lt;P&gt;The issue also comes up when I try updating my inventory file.&amp;nbsp; If I have two or more of the same item in the same transaction, the first record works fine but subsequent reads fail.&lt;/P&gt;&lt;P&gt;Thanks,&lt;BR&gt;Tim</description><pubDate>Mon, 23 Oct 2006 09:53:14 GMT</pubDate><dc:creator>Tim Dol</dc:creator></item><item><title>RE: Locking Problem</title><link>http://forum.strataframe.net/FindPost3788.aspx</link><description>What isolation level are you using for your transaction processing?&amp;nbsp; Several of the isolation levels will lock the table on the first update, so you would be able to retrieve a record, but then after updating it, you wouldn't be able to query again until you committed or rolled back the transaction.</description><pubDate>Mon, 23 Oct 2006 08:38:04 GMT</pubDate><dc:creator>StrataFrame Team</dc:creator></item></channel></rss>