<?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 : Fixup ID for tables that are not connected</title>
  <link>http://www.ideablade.com/forum/</link>
  <description>This is an XML content feed of; DevForce Community Forum : DevForce 2010 : Fixup ID for tables that are not connected</description>
  <pubDate>Mon, 13 Apr 2026 19:12:43 -700</pubDate>
  <lastBuildDate>Thu, 05 Jul 2012 17:31:17 -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=3515</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>Fixup ID for tables that are not connected : Hi Erika,Try the following code...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=3515&amp;PID=13959#13959</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=912" rel="nofollow">DenisK</a><br /><strong>Subject:</strong> 3515<br /><strong>Posted:</strong> 05-Jul-2012 at 5:31pm<br /><br />Hi Erika,<div><br></div><div>Try the following code instead.</div><div><br></div><div><table width="99%"><tr><td><pre class="BBcode"></div><div><div>this.SaveOptions.TransactionSettings = new TransactionSettings(IsolationLevel.ReadCommitted, TimeSpan.FromSeconds(30), true);</div><div>var trxOptions = this.SaveOptions.TransactionSettings.ToTransactionOptions();</div><div><br></div><div>var scope = new TransactionScope(TransactionScopeOption.RequiresNew, trxOptions);</div><div>using (scope)&nbsp;</div><div>{</div></div><div>..........Your code here............</div><div>}</div><div></pre></td></tr></table></div><div><br></div><div>1. Notice that I use a different&nbsp;<b>TransactionScope(TransactionScopeOption, TransactionOptions)</b>&nbsp;constructor here. There appears to be a bug in .NET when using the&nbsp;<b>TransactionScope(TransactionScopeOption)</b>&nbsp;constructor.</div><div><br></div><div>2. If you want to modify the TransactionSettings on the server, use this.SaveOptions.TransactionSettings instead. By the time the save gets to the server, it'll grab the TransactionSettings from SaveOptions and so this is the instance that you want to modify.</div>]]>
   </description>
   <pubDate>Thu, 05 Jul 2012 17:31:17 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=3515&amp;PID=13959#13959</guid>
  </item> 
  <item>
   <title>Fixup ID for tables that are not connected : Hi,I have several tables; some...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=3515&amp;PID=13942#13942</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=1475" rel="nofollow">erika</a><br /><strong>Subject:</strong> 3515<br /><strong>Posted:</strong> 04-Jul-2012 at 3:22am<br /><br />Hi,<div><br></div><div>I have several tables; some are connected, some are not. During save, when I save a record in table A, it should create a record in table B. Table B has ID field that should be retrieved from table A's ID. However, there's no association between table A &amp; B. I can't add association because ID field in table A is also used by other tables as foreign key.&nbsp;</div><div><br></div><div>During Save process, the table A's ID saved in table B are not fixed up, because there's no association.</div><div><br></div><div>To solve this issue, I tried to use EntityServerSaveInterceptor to intercept the save process. Here's what I'm trying to do in the interceptor.</div><div><br></div><div><div>using (TransactionScope scope = new TransactionScope(TransactionScopeOption.RequiresNew))</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; TransactionSettings.Default = new TransactionSettings(IsolationLevel.ReadCommitted, TimeSpan.FromSeconds(30), true);</div></div><div><br></div><div>base.ExecuteSave();</div><div><br></div><div>//get ID value in table A</div><div>//update the ID field in table B</div><div><br></div><div><div>scope.Complete();</div><div><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return true;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</div></div><div><br></div><div>However, I get error:&nbsp;</div><div>"The transaction specified for TransactionScope has a different IsolationLevel than the value requested for the scope."</div><div><br></div><div>I'm not sure whether this is allowed. If not, could anyone suggest a solution ? Thanks a lot !</div>]]>
   </description>
   <pubDate>Wed, 04 Jul 2012 03:22:13 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=3515&amp;PID=13942#13942</guid>
  </item> 
 </channel>
</rss>