Community
Participate
Working Groups
When coding CommitIntegrityCheck, my understanding was that only containment refs and refs with eOpposites would have to be checked. What I overlooked, is that if the refTarget is a NEW object, then it too must be included in the partial commit, even if the ref is non-containment and has no eOpposite.
Created attachment 190350 [details] Patch (including testcase)
Note that I've also sneaked in a minor improvement in the partial commit API. I'm changing the committables set from Set<EObject> to Set<? extends EObject>. I should have done it that way from the start, methinks.
Committed revision 7425.
Patch introduces a bug: CommitIntegrityCheck.checkFeatureDelta will throw an exception at the bottom of the method, if containmentOrWithOpposite==false and the delta is not one either CDOSetFeatureDelta or CDOAddFeatureDelta.
Created attachment 190813 [details] Patch (incremental)
For your reviewing convenience: it looks like a big change in the diff view, but it's not. I simply replaced the recurring else if (containmentOrWithOpposite && ...) condition with a single if (containmentOrWithOpposite) enclosing all relevant branches.
Committed revision 7436.
Still not working perfectly. The remaining problem (or rather: "one known remaining problem") is that normal (non-bidi) refTargets of NEW objects that *are* included, are not checked. This is a problem if those targets themselves are NEW, and its a containment reference. In those cases, those targets must be included in the commit, but currently the CommitIntegrityCheck doesn't detect the problem.
Created attachment 193678 [details] Patch (incremental, including testcase)
(In reply to comment #8) > This is a problem if those targets themselves are NEW, and its > a containment reference. No no no Caspar, don't be silly!! Whether the ref is containment or not doesn't matter; even if it's non-containment, the target must be committed otherwise it'll be a dangling reference. I see you got it right in the patch though.
;-)
Committed revision 7635.
Available in R20110608-1407