Community
Participate
Working Groups
There are situations when dirty revision is compared with clean revision in order to get change deltas. One of such places is ComitIntegrityChecker. Whenever we use chunk loading for collection, there is state, when clean revision contains CDOElementProxy, while dirty revision for the same object is filled with loaded CDOID. Comparing such revisions, we get deltas describing CDOElementProxy removing and adding CDOID objects. Hence we get many odd deltas and by itself CDORemoveFeatureDelta contains CDOElementProxy as value, which doesn't look expected value.
Created attachment 189296 [details] test case
The solution appears straightforward at first... the comparison logic should refuse to compare elements that are instances of CDOElementProxy. But the trouble is that the comparison logic is in emf.cdo.common while CDOElementProxy is in emf.cdo. So the comparison logic cannot recognize CDOElementProxies, unless... ... we move CDOElementProxy to emf.cdo.common. Which isn't unreasonable because CDOElementProxy is really only used in CDORevisions, which are also in emf.cdo.common. But the complication is that CDOElementProxy depends on CDOSession... which is in emf.cdo and should stay there (I think). And surely we don't want emf.cdo.common to depend on emf.cdo. A nice case of entangled dependencies... any ideas anyone?
Created attachment 191812 [details] Patch v1 Moved various classes from emf.cdo to emf.cdo.common: - CDOElementProxy - CDOElementProxyImpl - CDOListWithElementProxiesImpl Added proxy detection in the compare logic. This doesn't really fix the bug yet, but at least properly detects the problem.
Created attachment 191969 [details] Patch v2
Created attachment 191976 [details] Patch v3
CDOElementProxy does not seem to exist anymore. Please fix the patch...
Perhapüs a crash corrupted my workspace. Trying again...
No, the ptahc removes CDOElementProxy but leaves some classes referring to it.
Now this *is* a problem with SVN. If you move classes (as I did with the CDOElementProxy* stuff), svn diff doesn't include their addition in its output. I'll work around this by doing a delete-and-add (as opposed to a move) for generating the patch. For the real commit, I'll do a move (so that the history of the files won't be lost). Btw.. it seems this shortcoming of 'svn diff' will be addressed in Subversion 1.7.
Created attachment 192516 [details] Patch v4
Created attachment 192519 [details] Patch v5
Committed revision 7588.
Available in R20110608-1407
The committed solution does not fix the reported problem. I've disabled org.eclipse.emf.cdo.tests.bugzilla.Bugzilla_337587_Test._testRevisionCompare() meanwhile.
Created attachment 208490 [details] Fixed test case As per skype conversation with Eike agreed, test do not identifies provided fix. Fixed test case to match fix.
Thank you! commit 65d10b1e3f523b1139289c9aa70208ce57779ab4
*** Bug 369646 has been marked as a duplicate of this bug. ***
Closing.