Open kolovos opened 1 year ago
This also seems to happen from within Eclipse using a RunConfiguration. I am running an ETL transformation and the output Ecore model is not "unloaded" resulting in duplicate elements each time I run the transformation.
Until this gets properly fixed, a workaround would be to manually dispose of the problematic models using the Model Cache
view.
If you point me to some suspects I could take a look. So far I have not been able to identify any static field or 'registry' implementations that might be causing it.
The culprit seems to be org.eclipse.epsilon.emc.emf.CachedResourceSet
which is a global cache for EMF resources. The rationale behind this class is that if you load the same model file twice as an EmfModel
, the two models will be underpinned by the same resource and therefore their EObjects will be identical.
After the following ANT build file
is executed against the following models
m1.ecore
andm2.ecore
that reference each other, the models are not disposed properly. As a result, if we re-execute the same build file in the same JVM, the contents ofm2.ecore
are not loaded from disk the second time.A workaround for this is to add the following JavaScript task to the build file to clear the EMF driver's resource cache.