<?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 : Identity - Clustered Primary Key</title>
  <link>http://www.ideablade.com/forum/</link>
  <description>This is an XML content feed of; DevForce Community Forum : DevForce 2010 : Identity - Clustered Primary Key</description>
  <pubDate>Wed, 29 Jul 2026 15:11:57 -700</pubDate>
  <lastBuildDate>Mon, 14 Feb 2011 13:16:09 -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=2497</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>Identity - Clustered Primary Key : Hi robdrye;Yes, it&amp;#039;s confirmed....</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2497&amp;PID=9945#9945</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> 2497<br /><strong>Posted:</strong> 14-Feb-2011 at 1:16pm<br /><br />Hi robdrye;<div><br></div><div>Yes, it's confirmed. I ran the exact same tests on 6.0.3.1 and they failed.</div>]]>
   </description>
   <pubDate>Mon, 14 Feb 2011 13:16:09 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2497&amp;PID=9945#9945</guid>
  </item> 
  <item>
   <title>Identity - Clustered Primary Key : Denis -   We are on version...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2497&amp;PID=9936#9936</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=553" rel="nofollow">robdrye</a><br /><strong>Subject:</strong> 2497<br /><strong>Posted:</strong> 12-Feb-2011 at 12:56am<br /><br />Denis -<DIV>&nbsp;</DIV><DIV>&nbsp; We are on version 6.0.3.1 which as you indicated is not the latest.&nbsp; Can you confirm that the issue we are experiencing is a bug which has been fixed since our version?&nbsp;</DIV>]]>
   </description>
   <pubDate>Sat, 12 Feb 2011 00:56:13 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2497&amp;PID=9936#9936</guid>
  </item> 
  <item>
   <title>Identity - Clustered Primary Key : Hi robdrye;I couldn&amp;#039;t repro...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2497&amp;PID=9933#9933</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> 2497<br /><strong>Posted:</strong> 11-Feb-2011 at 6:46pm<br /><br />Hi robdrye;<div><br></div><div>I couldn't repro the issue. I did my test with the following:</div><div><br></div><div>1. A parent table with a clustered primary key on 2 columns (1 identity, 1 set in the client)</div><div>2. A child table with an identity primary key with a clustered foreign key to the parent table described in #1</div><div>3. A child table with&nbsp;a clustered primary key on 2 columns (1 identity, 1 set in the client)&nbsp;with a clustered foreign key to the parent table described in #1</div><div><br></div><div>In all cases, the save was successful in 1 transaction.</div><div><br></div><div>What version are you using?&nbsp;I suspect that you might be using an older version and that the bug has already been fixed.</div>]]>
   </description>
   <pubDate>Fri, 11 Feb 2011 18:46:11 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2497&amp;PID=9933#9933</guid>
  </item> 
  <item>
   <title>Identity - Clustered Primary Key : Found these steps to actually...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2497&amp;PID=9929#9929</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=553" rel="nofollow">robdrye</a><br /><strong>Subject:</strong> 2497<br /><strong>Posted:</strong> 11-Feb-2011 at 12:37pm<br /><br /><DIV>Found these steps to actually work:</DIV><DIV>&nbsp;</DIV><DIV>1.) Save the parent Entity with the clustered key which completes fine and returns with the db-generated identity value.</DIV><DIV>2.) Create the child Entity, associate with the parent, and save.</DIV><DIV>&nbsp;</DIV><DIV>This is clearly not the safe or desired approach as 1 &amp; 2 occur in separate Transactions.</DIV><DIV>&nbsp;</DIV>]]>
   </description>
   <pubDate>Fri, 11 Feb 2011 12:37:48 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2497&amp;PID=9929#9929</guid>
  </item> 
  <item>
   <title>Identity - Clustered Primary Key : Thanks for the reply Denis.  We...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2497&amp;PID=9923#9923</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=553" rel="nofollow">robdrye</a><br /><strong>Subject:</strong> 2497<br /><strong>Posted:</strong> 11-Feb-2011 at 9:24am<br /><br />Thanks for the reply Denis.<DIV>&nbsp;</DIV><DIV>We confirmed we are able to save a lone entity which contains a clustered key as described in my original post and verified by you.&nbsp; The actual problem has turned out to&nbsp;occur when there is a child Entity linked back to a parent Entity on the clustered key.&nbsp; In code we can do everything to create the&nbsp;2&nbsp;Entities (initialize, associate, add to EM) however when we save changes the Exception from my original posting is encountered.</DIV>]]>
   </description>
   <pubDate>Fri, 11 Feb 2011 09:24:55 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2497&amp;PID=9923#9923</guid>
  </item> 
  <item>
   <title>Identity - Clustered Primary Key :   Hi robdrye;No, it doesn&amp;#039;t....</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2497&amp;PID=9913#9913</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> 2497<br /><strong>Posted:</strong> 09-Feb-2011 at 11:37pm<br /><br />Hi robdrye;<div><br></div><div>No, it doesn't. I did the same test, i.e. saving an entity with a clustered primary key on 2 integer columns (1 identity, 1 set by the client) and did not encounter any exception. Could you provide more info about your entity model? Or if possible, a sample solution?</div><div><br></div><div>Also, what version are you using?</div><span style="font-size:10px"><br /><br />Edited by DenisK - 09-Feb-2011 at 11:41pm</span>]]>
   </description>
   <pubDate>Wed, 09 Feb 2011 23:37:18 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2497&amp;PID=9913#9913</guid>
  </item> 
  <item>
   <title>Identity - Clustered Primary Key : I&amp;#039;m hitting the following...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2497&amp;PID=9907#9907</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=553" rel="nofollow">robdrye</a><br /><strong>Subject:</strong> 2497<br /><strong>Posted:</strong> 09-Feb-2011 at 7:57am<br /><br /><P>I'm hitting the following Exception when trying to save an Entity generated from a legacy database table we have:</P><DIV>{System.NullReferenceException: Object reference not set to an instance of an object.<BR>&nbsp;&nbsp; at IdeaBlade.EntityModel.NavigationEntityProperty.GetEntityReference(Object entity)<BR>&nbsp;&nbsp; at IdeaBlade.EntityModel.IdFixupHelper.ValidateTempIds(EntityManager entityManager, IList`1 entityWrappers)<BR>&nbsp;&nbsp; at IdeaBlade.EntityModel.EntityManager.InitializeWorkStateTempIds(SaveWorkState saveWorkState)}</DIV><DIV>&nbsp;</DIV><DIV>The table has a clustered primary key on two integer columns&nbsp;- the first column&nbsp;is a SQL Identity column which auto-generates a value and the other column is an integer which needs to be set in the application logic.&nbsp; I'm setting the value required for the second column before saving and assumed the Identity value for the first column would be handled like any other Identity column.&nbsp; Does this scenario require a custom implementation of IIdGenerator?</DIV><DIV>&nbsp;</DIV><DIV>Thanks for any replies.</DIV>]]>
   </description>
   <pubDate>Wed, 09 Feb 2011 07:57:49 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2497&amp;PID=9907#9907</guid>
  </item> 
 </channel>
</rss>