title: Silverlight & RIA & POCO: SubmitOperationFailed when INSERTING two new child entities. An entity with the same ID exists
body: <p>Here's my scenario: </p>
  
  <p>I am using Silverlight, RIA and POCO objects (no Entity Framework; we're working against Oracle and SP's). </p>
  
  <p>I have a Parent object that contains a collection of Child objects. I have setup the Association and Composition attributes on the Parent correctly. When I want to save changes, the entire object graph gets sent to the server correctly. </p>
  
  <p>The user can add one or more Child objects to the Parent.</p>
  
  <p>Now, if the user adds ONE Child object to the Parent and saves it then everything works. However, when the user tries to add TWO or more new objects to the Parent and then persist, I get the classic error: </p>
  
  <blockquote>
    <p>System.ServiceModel.DomainServices.Client.DomainOperationException: Submit operation failed. An entity with the same identity already exists in this EntitySet. ---> System.InvalidOperationException: An entity with the same identity already exists in this EntitySet.</p>
  </blockquote>
  
  <p>Now, this is failing on the client. I am tracing everything - the database actually gets updated! Everything gets sent down to the server correctly, the DB gets updated. I check the object keys on the server when the re-query happens and they are correct - all of the new child objects get their ID's updated from zero to a real number in sequence. </p>
  
  <p>It's when I get to re-load the Parent object on the client that I get this error. I don't get it. I am newing up a new Context on the re-load operation; it should be empty and just load the Parent and associated Children. I check the data on the server side before it goes out of the query method - the parent and child data is fine. So what's happening? Why is my context bitching about not being able to complete this SubmitOperation? </p>