A problem with model loading of models [message #1753883] |
Sat, 11 February 2017 14:39 |
Eclipse User |
|
|
|
Hello,
"Loading models" part of the models transformations takes forever for the metamodels that has "id" feature on for some attribute. If you are using the configuration interface, Eclipse freezes, which is the same problem with "takes forever".
The problem occurs even for the models around 20 mb, which work well if their metamodel does not have id feature set.
I have attached an minimal example with necessary configurations. exampleReadOnlyTransformation is enough for experiencing the problem.
exampleModelCreatorTransformation can be used to create various sizes of models to test.
Thanks.
|
|
|
Re: A problem with model loading of models [message #1754026 is a reply to message #1753883] |
Mon, 13 February 2017 22:17 |
|
Hi Bugra,
Many thanks for putting in the effort to write a model generator and demonstrate the problem! It appears that the culprit for this is EMF's DEFER_IDREF_RESOLUTION flag which the Epsilon EMF bridge sets to true by default (this should be "a good thing" according to [1]). To work around this, please un-tick the "Read on load" option in your model's configuration dialog and add the following line at the beginning of the first pre section of your transformation.
InSGMMModel.resource.load(Map{"DEFER_IDREF_RESOLUTION" = false});
Cheers,
Dimitris
[1] https://www.eclipse.org/modeling/emf/docs/performance/EMFPerformanceTips.html
|
|
|
Re: A problem with model loading of models [message #1754211 is a reply to message #1754026] |
Wed, 15 February 2017 13:07 |
Eclipse User |
|
|
|
Dimitris,
Thanks for the reply. This actually seems to solve the problem. I checked it and I agree with you to take this flag to be true by default, as suggested.
This reference resolving may perform different depending on the model structure (number forward / backward references in the XML file), which was the case for the example project.
|
|
|
Re: A problem with model loading of models [message #1754327 is a reply to message #1754211] |
Thu, 16 February 2017 12:12 |
Eclipse User |
|
|
|
Hello Dimitris,
I have worked on the problem some more, not on the minimal example I shared, but on the real example I am working with.
The solution you offered works well with the minimal example, but not with the real one.
After searching for a while, I have found the following solution that worked:
<Model name>.resource.setIntrinsicIDToEObjectMap(new Native("java.util.HashMap"));
<Model name>.resource.load(null);
As far as I understood, this provides a hash to record the processed XML elements with intrinsic ids for lazy reference resolving.
|
|
|
|
Powered by
FUDForum. Page generated in 0.03442 seconds