<?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 : Duplicate Ids in UOW Manager</title>
  <link>http://www.ideablade.com/forum/</link>
  <description>This is an XML content feed of; DevForce Community Forum : Community Forum : Duplicate Ids in UOW Manager</description>
  <pubDate>Sat, 11 Apr 2026 01:13:45 -700</pubDate>
  <lastBuildDate>Fri, 27 Sep 2013 06:54:23 -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=4379</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>Duplicate Ids in UOW Manager : Thx, got this going. </title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=4379&amp;PID=16925#16925</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=579" rel="nofollow">gregweb</a><br /><strong>Subject:</strong> 4379<br /><strong>Posted:</strong> 27-Sep-2013 at 6:54am<br /><br />Thx, got this going.]]>
   </description>
   <pubDate>Fri, 27 Sep 2013 06:54:23 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=4379&amp;PID=16925#16925</guid>
  </item> 
  <item>
   <title>Duplicate Ids in UOW Manager : Yes, this is highlighting a fundamental...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=4379&amp;PID=16916#16916</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=1005" rel="nofollow">mgood</a><br /><strong>Subject:</strong> 4379<br /><strong>Posted:</strong> 26-Sep-2013 at 8:21pm<br /><br />Yes, this is highlighting a fundamental issue with database generated ids. They violate the fundamental principal of an entity, which says that the identity of an entity should never change. The data can change, but the entity shall maintain the same id. With database generated ids you are running into these kinds of issues. You can't uniquely identify new entities, because you don't know the permanent id until you save them. What you should do in this case is after you saved, you should remove the UoW from the dictionary and add it back with the permanent id. This is commonly referred to as id fixup. DevForce does this with the entities in the cache. It fixes up their ids after a successful save.&nbsp;<div><br></div>]]>
   </description>
   <pubDate>Thu, 26 Sep 2013 20:21:45 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=4379&amp;PID=16916#16916</guid>
  </item> 
  <item>
   <title>Duplicate Ids in UOW Manager : In an app, I use integer keys...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=4379&amp;PID=16915#16915</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=579" rel="nofollow">gregweb</a><br /><strong>Subject:</strong> 4379<br /><strong>Posted:</strong> 26-Sep-2013 at 8:01pm<br /><br />In an app, I use integer keys instead of Guids.  So far this has worked fine.  However, when creating new items, the new ID generated by DevForce is -100.  This works the first time the user creates an item.  However, if the user then saves that item, and creates another one, the id is again -100.<br /><br />This doesn't work for the WeakRefDictionary as the former -100 is still there, so it throws a KeyIsAlreadyPresentInThisDictionary exception.<br /><br />I am not sure of the best way to resolve this, but it seems to me I could update the WeakRefDictionary to remove the existing one if it found the same key already, instead of throwing an error.<br /><br />Greg]]>
   </description>
   <pubDate>Thu, 26 Sep 2013 20:01:22 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=4379&amp;PID=16915#16915</guid>
  </item> 
 </channel>
</rss>