Hello all
I'm having a problem merging an object where the id is generated by user assignment. It seems the presence of a value for the id property causes the merge to decide that the instance is detached rather than transient, leading to a StaleObjectStateException. For most other purposes the version property is used to determine transience instead, which would remove this problem.
Question: why does merge trust the id property even where the class is configured for user assigned ids? Is there some reason its can't detect that case and look at the version property instead? Is this a bug and if not, is there a workaround? Writing my own wrapper for merge seems like a bit of a kludge.
Thanks
|