title: EF4 - Updating the same table row twice in the same context from different objects not possible?
body: <p>When I receive the same table row twice for updating in the same context I get:</p>
  
  <p>"<strong>AcceptChanges cannot continue because the object's key values conflict with another object in the ObjectStateManager. Make sure that the key values are unique before calling AcceptChanges.</strong>"</p>
  
  <p>The problem happens at the ChangeState method.</p>
  
  <p>What I have can be simplified to this:</p>
  
  <pre><code>        var obj1 = new test() { id = 1,name = "oiu"};
          var dc = Context.Create();
  
          dc.test.AddObject(obj1);
          if (dc.test.Any(a =&gt; a.id == obj1.id))
              dc.ObjectStateManager.GetObjectStateEntry(obj1).ChangeState(EntityState.Modified);
          dc.SaveChanges();
  
          //---- another iteration of the reading thread, another object, but same context:
  
          var obj2 = new test() { id = 1, name = "ois" };
          dc.test.AddObject(obj2);
          if (dc.test.Any(a =&gt; a.id == obj2.id))
              dc.ObjectStateManager.GetObjectStateEntry(obj2).ChangeState(EntityState.Modified);
          dc.SaveChanges();
  </code></pre>
  
  <p>Is there a way out or around?</p>