eclipse-ocl / org.eclipse.ocl

Eclipse Public License 2.0
0 stars 0 forks source link

[delegates] Constraint cached not refreshed by Ecore change #705

Closed eclipse-ocl-bot closed 3 weeks ago

eclipse-ocl-bot commented 3 weeks ago

| --- | --- | | Bugzilla Link | 347644 | | Status | CLOSED FIXED | | Importance | P3 normal | | Reported | May 30, 2011 08:36 EDT | | Modified | May 20, 2013 11:36 EDT | | Version | 3.1.0 | | Reporter | Ed Willink |

Description

Following the OCLinEcore tutorial, create Tutorial.xmi and validate to show the 3 loans for 2 copies validation error.

Upgrade the Ecore to have a custom message or just a different Invariant name spelling

Result: OCLDelegateException for Missing or invalid body constraint for 'null'

Problem is that the the AbstractOCLDelegateFactory which is initially created for the delegateURI caches the lazily created OCLDelegateDomain. THis is sound when meta-models are stable since why recreate. However if the meta-model changes the cache can be stale, which is insidious for the pivot model since the TypeManager for the Pivot counterparts of the Ecore is cached in the OCLDelegateDomain that is cached in the factory.

Need to provide strong bidirectional Ecore <=> Pivot synchronization.

eclipse-ocl-bot commented 3 weeks ago

By Ed Willink on May 30, 2011 11:07

Created attachment 196910 Eliminate delegate domain cache

For the pivot model, the persistence of a TypeManager in the cache is clearly invalid. Attached therefore eliminates it and adds a test to demonstrate flipping between Ecore resource versions.

For the mature code, it may take some quite detailed white box study to contrive a similar failure; certainly not an activity for RC3.

Please +1 the attached for the Pivot Model at RC3.

:notepad_spiral: Bug347644.patch

eclipse-ocl-bot commented 3 weeks ago

By Axel Uhl on May 30, 2011 11:39

Ed, isn't the OCLDelegateDomain still cached in DelegateEPackageAdapter.delegateDomainMap? This cache seems to be relied upon also by the call to ePackageAdapter.getDelegateDomain(delegateURI) that your patch now does every time. If the EPackage is changed without entirely discarding and reloading it (e.g., by an in-place editing), the DelegateEPackageAdapter will reside in the package's adapters list, and so will its delegateDomainMap cache. Why is the patch only dealing with the more local cache in AbstractOCLDelegateFactory?

eclipse-ocl-bot commented 3 weeks ago

By Ed Willink on May 30, 2011 11:49

(In reply to comment #2)

Ed, isn't the OCLDelegateDomain still cached in DelegateEPackageAdapter.delegateDomainMap?

Yes, but the DelegateEPackageAdapter is for an EPackage object so a reload creates a different Epackage and so different DelegateEPackageAdapter. The problem arises when caches are located by a String behind which an EObject chances unnoticed.

eclipse-ocl-bot commented 3 weeks ago

By Axel Uhl on May 30, 2011 11:59

Understood. Then: +1

eclipse-ocl-bot commented 3 weeks ago

By Ed Willink on Nov 08, 2011 13:35

This was committed in May.

eclipse-ocl-bot commented 3 weeks ago

By Ed Willink on May 20, 2013 11:36

CLOSED after a year in the RESOLVED state.