The problem is caused by this: Everything goes as planned, except when the FK field ClaimId in DisputeDetail dde02 has to be set to the new ClaimId pk value of its new master dme02: the code only syncs FK fields which are not a PK or when the entity is new. As the entity isn't new and the field to sync the value of is a PK field, it doesn't allow it.
This leaves the FK field ClaimId in DisputeDetailEntity dde02 as-is and it's therefore not changed during the save actions, and nothing is done.
Question now is: is that check (do not sync PK fields) there for a reason or not. We have to dig into history logs of the sourcecontrol system / design docs to find out. It's likely a left-over from the early years when PK updates weren't allowed. This was added later on. If it's safe to update this check, we'll remove it and your code should work as-is with the patched dll. But till then, use the workaround.
(edit) as I expected, it's been there since day 1 (we moved to Subversion in february 2004 from VSS, it's been this way since that initial day. PK updates were not possible back then, so the check was justified. Today, not so much)
We'll make the change and see whether it breaks anything.
(edit) heh
This isn't really going to work with just our code. The problem is... DisputeDetailDescription, the one related to dde02. It points to dde02 using dde02's old PK value for ClaimId (e.g. 8 ). Saving the new master dme02 will for example result in the new value of 11 for ClaimId. However... it's not possible to change the PK of dde02's table row: the update fails, because the DisputeDetailDescription entity points to a disputeDetail with the old pk values, which is no longer there after the update, however first updating disputedetaildescription to the new value won't work either as dde02 isn't saved at that point with the new pk value: catch 22.
It could work if cascading updates are enabled in the DB, on the FK constraint. However, these are often overlooked when for example moving a schema or other things, and the application then breaks at runtime at some point.
I.o.w.: the workaround is actually the best way: copy the data, remove the old ones, re-insert the older data as new entities. Fix rolled back (as it doesn't really fixes all situations, only moves problems to a different location)