Bug 454547 - [Legacy] EContentAdapter not added on all model elements
Summary: [Legacy] EContentAdapter not added on all model elements
Status: ASSIGNED
Alias: None
Product: EMF
Classification: Modeling
Component: cdo.legacy (show other bugs)
Version: 4.13   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Esteban DUGUEPEROUX CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 392720
Blocks:
  Show dependency tree
 
Reported: 2014-12-09 05:10 EST by Esteban DUGUEPEROUX CLA
Modified: 2020-12-11 10:47 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Esteban DUGUEPEROUX CLA 2014-12-09 05:10:37 EST
Having 2 CDOResources, a first one containing a model element 'A' referencing another model element 'B' contained in second CDOResource, model element 'B' contains a child.
Open a transaction, setting up a EContentAdapter and a ECrossReferenceAdapter on the ResourceSet of the transaction and calling CDOTransaction.getResource() on the first resource, we can see that EContentAdapter and ECrossReferenceAdapter are not added to child of model element 'B' in legacy while it works fine in native.
Comment 1 Esteban DUGUEPEROUX CLA 2014-12-09 05:12:30 EST
See https://git.eclipse.org/r/37802 for the test showing the bug.
Comment 2 Esteban DUGUEPEROUX CLA 2014-12-09 06:53:29 EST
The issue comes from that when ECrossReferenceAdapter analyze cross references from model element 'A' to model element 'B', in legacy CDOLegacyWrapper.cdoInternalPostLoad() is called to create a CDOObject of model element 'B'.
Then CDOLegacyWrapper.revisionToInstance() is called to initialize field of EObject instance. But as we try to initialize resource and container fields before feature fields, the model element 'B' CDOObject is not fully constructed than we have EContentAdapter which access its feature fields and conclude that model element 'B' hasn't children.
It is CDOLegacyWrapper.getEObjectFromPotentialID() which trigger load of second CDOResource when called through CDOLegacyWrapper.

I have updated the Gerrit to include a fix in CDOLegacyWrapper.revisionToInstance() to manage feature fields before resource/container fields.
But a better fix would be to have legacy object loaded/constructed before behind registred in CDOViewImpl.objects cache and not have its construction trigger other object load/construction from CDOLegacyWrapper.getEObjectFromPotentialID().
Perhaps we should create proxy for these fieds at least for resource one.
Comment 3 Esteban DUGUEPEROUX CLA 2014-12-09 08:30:52 EST
With Bug 392720 fixed, i.e. have support of EMF proxy in CDO, we could fix correctly that.
Comment 4 Esteban DUGUEPEROUX CLA 2014-12-09 10:23:24 EST
We must care of not breaking fix of Bug 393164 i.e. support of Resource$Internal.isLoading() contract in legacy.
Comment 5 Eike Stepper CLA 2015-07-14 02:19:29 EDT
Moving all open bugzillas to 4.5.
Comment 6 Eike Stepper CLA 2016-07-31 01:02:11 EDT
Moving all unaddressed bugzillas to 4.6.
Comment 7 Eike Stepper CLA 2017-12-28 01:10:21 EST
Moving all open bugs to 4.7
Comment 8 Eike Stepper CLA 2019-11-08 02:04:58 EST
Moving all unresolved issues to version 4.8-
Comment 9 Eike Stepper CLA 2019-12-13 12:42:15 EST
Moving all unresolved issues to version 4.9
Comment 10 Eike Stepper CLA 2020-12-11 10:47:48 EST
Moving to 4.13.