Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc) » No notifications for changes to model objects after saving a JpoxResource
|
Re: No notifications for changes to model objects after saving a JpoxResource [message #115819 is a reply to message #115806] |
Wed, 26 March 2008 11:37 |
Martin Taal Messages: 5468 Registered: July 2009 |
Senior Member |
|
|
Hi Florian,
It seems that the issue is related to the loaded member of the persistableelist.
A few questions:
is the loaded member of the epersistableelist also false before saveResource(options) is called?
so the contents of the persistableelist is really loaded (it should be as the notifications flag of
its content is set to false)?
During save no notifications should be sent out, however it is a bug if the notification flag is not
repaired afterwards.
If the loaded flag is set to false during the saveResource, then if you can debug where this happens
then it is probably easy to solve.
gr. Martin
DI Florian Hackenberger wrote:
> Hi!
>
> I'm using an EMF editor backed by Teneo with a JpoxResource. In addition I'm
> using the EMF validation framework with a live validation. Upon loading the
> editor with the resource, notifications about model changes are passed to
> my validation class. After saving the resource however, changes to the
> model do not result in any notifications. I have debugged the problem a
> bit. Upon a call to a setter method on a model object, the method checks
> for eNotificationRequired() and sends a notification if the check returns
> true. It returns true before hitting save, but it does not after the
> resource was saved once.
>
> The following code is an excerpt of the save(Map<?, ?> options) method of
> StoreResource:
>
> public void save(Map<?, ?> options) {
> boolean err = true;
> try {
> setAllowNotifications(false);
> validateContents();
> saveResource(options);
> err = false;
> } finally {
> setAllowNotifications(true);
> .......
> }
> }
>
> It disables notifications, saves the resource and enabled notifications
> afterwards. The problem is that the second call to setAllowNotifications()
> does not propagate to all model objects. The reason is the use of the
> NonLoadingEContentsEList class in getNonResolvingContent(EObject) of the
> StoreResource class. setAllowNotifications(boolean) uses this method to
> iterate over the content and the loaded member variable of the
> PersistableEList of the reference containing all model elements is false
> after saving the resource.
>
> Shall I file a bug or is that expected behaviour?
>
> Cheers,
> Florian
--
With Regards, Martin Taal
Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
|
|
|
Re: No notifications for changes to model objects after saving a JpoxResource [message #115845 is a reply to message #115819] |
Wed, 26 March 2008 13:34 |
Florian Hackenberger Messages: 123 Registered: July 2009 |
Senior Member |
|
|
Martin Taal wrote:
> It seems that the issue is related to the loaded member of the
> persistableelist.
It certainly is if the use of NonLoadingEContentsEList is correct.
> A few questions:
> is the loaded member of the epersistableelist also false before
> saveResource(options) is called? so the contents of the persistableelist
> is really loaded (it should be as the notifications flag of its content is
> set to false)?
It is set to true before hitting save and set to false afterwards.
> During save no notifications should be sent out, however it is a bug if
> the notification flag is not repaired afterwards.
>
> If the loaded flag is set to false during the saveResource, then if you
> can debug where this happens then it is probably easy to solve.
It is not actually set to false. A new instance of EListWrapper is generated
for the structural feature when
List<?> list = (List<?>) eObject.eGet(eref);
is called in NonLoadingEContentsEList::create(EObject, boolean) after the
call to saveResource(options). The new instance has its attribute loaded
set to false, because JPOXArrayList::isLoaded() returns false and therefore
the load() method of EListWrapper is not invoked in the constructor
EListWrapper(StateManager, String, List<E>)
Here is the stack trace:
EListWrapper<E>.<init>(StateManager, String, List<E>) line: 137
EListWrapper<E>.<init>(StateManager, String) line: 105
EListMapping.createWrapper(StateManager, String, List<?>) line: 190
EListMapping.newWrapper(StateManager, String) line: 59
EListMapping.postFetch(StateManager) line: 223
FetchRequest.execute(StateManager) line: 228
ClassTable.fetch(StateManager, AbstractPropertyMetaData[]) line: 2552
RDBMSManager(StoreManager).fetch(StateManager, int[]) line: 959
StateManagerImpl.loadNonDFGFields(int[]) line: 1734
StateManagerImpl.isLoaded(PersistenceCapable, int) line: 2034
CallcenterConfigurationImpl.jdoGetelements(CallcenterConfigu rationImpl)
line: not available
CallcenterConfigurationImpl.getElements() line: 164
CallcenterConfigurationImpl.eGet(int, boolean, boolean) line: 328
CallcenterConfigurationImpl(BasicEObjectImpl).eGet(EStructur alFeature,
boolean, boolean) line: 1002
CallcenterConfigurationImpl(BasicEObjectImpl).eGet(EStructur alFeature,
boolean) line: 994
CallcenterConfigurationImpl(BasicEObjectImpl).eGet(EStructur alFeature) line:
989
NonLoadingEContentsEList<E>.create(EObject, boolean) line: 48
JPOXResource(StoreResource).getNonResolvingContent(EObject) line: 807
StoreResource$2.getChildren(Object) line: 794
StoreResource$2(AbstractTreeIterator<E>).next() line: 142
JPOXResource(StoreResource).setAllowNotifications(boolean) line: 823
JPOXResource(StoreResource).save(Map<?,?>) line: 353
The original instance of the list is loaded via a call to eIsSet(int) for
the feature. Here is the stacktrace:
EListWrapper<E>(PersistableEList<E>).load() line: 207
EListWrapper<E>.load() line: 805
EListWrapper<E>(PersistableEList<E>).delegateIsEmpty() line: 376
EListWrapper<E>(DelegatingEList<E>).isEmpty() line: 241
CallcenterConfigurationImpl.eIsSet(int) line: 406
CallcenterConfigurationImpl(BasicEObjectImpl).eIsSet(EStruct uralFeature)
line: 1225
EContentsEList$ResolvingFeatureIteratorImpl<E>(EContentsEList$FeatureIteratorImpl <E>).hasNext()
line: 427
LiveValidationContentAdapter(EContentAdapter).setTarget(EObj ect) line: 222
To me it seems that the PersistableEList simply implements a lazy loading
scheme and setAllowNotifications() is not aware of this fact.
Cheers,
Florian
--
Florian Hackenberger
|
|
|
Re: No notifications for changes to model objects after saving a JpoxResource [message #115912 is a reply to message #115845] |
Wed, 26 March 2008 17:06 |
Martin Taal Messages: 5468 Registered: July 2009 |
Senior Member |
|
|
Yes the NonLoadingEContentsEList should be used here. What I don't yet
understand is why the StateManagerImpl.isLoaded call replaces the list, afaics it should re-use the
one which is already present, it should consider the field as being loaded.
Can you enter a bugzilla for this? Then I'll pick it up in the next build (this weekend).
gr. Martin
DI Florian Hackenberger wrote:
> Martin Taal wrote:
>> It seems that the issue is related to the loaded member of the
>> persistableelist.
> It certainly is if the use of NonLoadingEContentsEList is correct.
>
>> A few questions:
>> is the loaded member of the epersistableelist also false before
>> saveResource(options) is called? so the contents of the persistableelist
>> is really loaded (it should be as the notifications flag of its content is
>> set to false)?
> It is set to true before hitting save and set to false afterwards.
>
>> During save no notifications should be sent out, however it is a bug if
>> the notification flag is not repaired afterwards.
>>
>> If the loaded flag is set to false during the saveResource, then if you
>> can debug where this happens then it is probably easy to solve.
> It is not actually set to false. A new instance of EListWrapper is generated
> for the structural feature when
> List<?> list = (List<?>) eObject.eGet(eref);
> is called in NonLoadingEContentsEList::create(EObject, boolean) after the
> call to saveResource(options). The new instance has its attribute loaded
> set to false, because JPOXArrayList::isLoaded() returns false and therefore
> the load() method of EListWrapper is not invoked in the constructor
> EListWrapper(StateManager, String, List<E>)
>
> Here is the stack trace:
> EListWrapper<E>.<init>(StateManager, String, List<E>) line: 137
> EListWrapper<E>.<init>(StateManager, String) line: 105
> EListMapping.createWrapper(StateManager, String, List<?>) line: 190
> EListMapping.newWrapper(StateManager, String) line: 59
> EListMapping.postFetch(StateManager) line: 223
> FetchRequest.execute(StateManager) line: 228
> ClassTable.fetch(StateManager, AbstractPropertyMetaData[]) line: 2552
> RDBMSManager(StoreManager).fetch(StateManager, int[]) line: 959
> StateManagerImpl.loadNonDFGFields(int[]) line: 1734
> StateManagerImpl.isLoaded(PersistenceCapable, int) line: 2034
> CallcenterConfigurationImpl.jdoGetelements(CallcenterConfigu rationImpl)
> line: not available
> CallcenterConfigurationImpl.getElements() line: 164
> CallcenterConfigurationImpl.eGet(int, boolean, boolean) line: 328
> CallcenterConfigurationImpl(BasicEObjectImpl).eGet(EStructur alFeature,
> boolean, boolean) line: 1002
> CallcenterConfigurationImpl(BasicEObjectImpl).eGet(EStructur alFeature,
> boolean) line: 994
> CallcenterConfigurationImpl(BasicEObjectImpl).eGet(EStructur alFeature) line:
> 989
> NonLoadingEContentsEList<E>.create(EObject, boolean) line: 48
> JPOXResource(StoreResource).getNonResolvingContent(EObject) line: 807
> StoreResource$2.getChildren(Object) line: 794
> StoreResource$2(AbstractTreeIterator<E>).next() line: 142
> JPOXResource(StoreResource).setAllowNotifications(boolean) line: 823
> JPOXResource(StoreResource).save(Map<?,?>) line: 353
>
> The original instance of the list is loaded via a call to eIsSet(int) for
> the feature. Here is the stacktrace:
> EListWrapper<E>(PersistableEList<E>).load() line: 207
> EListWrapper<E>.load() line: 805
> EListWrapper<E>(PersistableEList<E>).delegateIsEmpty() line: 376
> EListWrapper<E>(DelegatingEList<E>).isEmpty() line: 241
> CallcenterConfigurationImpl.eIsSet(int) line: 406
> CallcenterConfigurationImpl(BasicEObjectImpl).eIsSet(EStruct uralFeature)
> line: 1225
> EContentsEList$ResolvingFeatureIteratorImpl<E>(EContentsEList$FeatureIteratorImpl <E>).hasNext()
> line: 427
> LiveValidationContentAdapter(EContentAdapter).setTarget(EObj ect) line: 222
>
> To me it seems that the PersistableEList simply implements a lazy loading
> scheme and setAllowNotifications() is not aware of this fact.
>
> Cheers,
> Florian
--
With Regards, Martin Taal
Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
|
|
| |
Re: No notifications for changes to model objects after saving a JpoxResource [message #615985 is a reply to message #115806] |
Wed, 26 March 2008 11:37 |
Martin Taal Messages: 5468 Registered: July 2009 |
Senior Member |
|
|
Hi Florian,
It seems that the issue is related to the loaded member of the persistableelist.
A few questions:
is the loaded member of the epersistableelist also false before saveResource(options) is called?
so the contents of the persistableelist is really loaded (it should be as the notifications flag of
its content is set to false)?
During save no notifications should be sent out, however it is a bug if the notification flag is not
repaired afterwards.
If the loaded flag is set to false during the saveResource, then if you can debug where this happens
then it is probably easy to solve.
gr. Martin
DI Florian Hackenberger wrote:
> Hi!
>
> I'm using an EMF editor backed by Teneo with a JpoxResource. In addition I'm
> using the EMF validation framework with a live validation. Upon loading the
> editor with the resource, notifications about model changes are passed to
> my validation class. After saving the resource however, changes to the
> model do not result in any notifications. I have debugged the problem a
> bit. Upon a call to a setter method on a model object, the method checks
> for eNotificationRequired() and sends a notification if the check returns
> true. It returns true before hitting save, but it does not after the
> resource was saved once.
>
> The following code is an excerpt of the save(Map<?, ?> options) method of
> StoreResource:
>
> public void save(Map<?, ?> options) {
> boolean err = true;
> try {
> setAllowNotifications(false);
> validateContents();
> saveResource(options);
> err = false;
> } finally {
> setAllowNotifications(true);
> .......
> }
> }
>
> It disables notifications, saves the resource and enabled notifications
> afterwards. The problem is that the second call to setAllowNotifications()
> does not propagate to all model objects. The reason is the use of the
> NonLoadingEContentsEList class in getNonResolvingContent(EObject) of the
> StoreResource class. setAllowNotifications(boolean) uses this method to
> iterate over the content and the loaded member variable of the
> PersistableEList of the reference containing all model elements is false
> after saving the resource.
>
> Shall I file a bug or is that expected behaviour?
>
> Cheers,
> Florian
--
With Regards, Martin Taal
Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
|
|
|
Re: No notifications for changes to model objects after saving a JpoxResource [message #615987 is a reply to message #115819] |
Wed, 26 March 2008 13:34 |
Florian Hackenberger Messages: 123 Registered: July 2009 |
Senior Member |
|
|
Martin Taal wrote:
> It seems that the issue is related to the loaded member of the
> persistableelist.
It certainly is if the use of NonLoadingEContentsEList is correct.
> A few questions:
> is the loaded member of the epersistableelist also false before
> saveResource(options) is called? so the contents of the persistableelist
> is really loaded (it should be as the notifications flag of its content is
> set to false)?
It is set to true before hitting save and set to false afterwards.
> During save no notifications should be sent out, however it is a bug if
> the notification flag is not repaired afterwards.
>
> If the loaded flag is set to false during the saveResource, then if you
> can debug where this happens then it is probably easy to solve.
It is not actually set to false. A new instance of EListWrapper is generated
for the structural feature when
List<?> list = (List<?>) eObject.eGet(eref);
is called in NonLoadingEContentsEList::create(EObject, boolean) after the
call to saveResource(options). The new instance has its attribute loaded
set to false, because JPOXArrayList::isLoaded() returns false and therefore
the load() method of EListWrapper is not invoked in the constructor
EListWrapper(StateManager, String, List<E>)
Here is the stack trace:
EListWrapper<E>.<init>(StateManager, String, List<E>) line: 137
EListWrapper<E>.<init>(StateManager, String) line: 105
EListMapping.createWrapper(StateManager, String, List<?>) line: 190
EListMapping.newWrapper(StateManager, String) line: 59
EListMapping.postFetch(StateManager) line: 223
FetchRequest.execute(StateManager) line: 228
ClassTable.fetch(StateManager, AbstractPropertyMetaData[]) line: 2552
RDBMSManager(StoreManager).fetch(StateManager, int[]) line: 959
StateManagerImpl.loadNonDFGFields(int[]) line: 1734
StateManagerImpl.isLoaded(PersistenceCapable, int) line: 2034
CallcenterConfigurationImpl.jdoGetelements(CallcenterConfigu rationImpl)
line: not available
CallcenterConfigurationImpl.getElements() line: 164
CallcenterConfigurationImpl.eGet(int, boolean, boolean) line: 328
CallcenterConfigurationImpl(BasicEObjectImpl).eGet(EStructur alFeature,
boolean, boolean) line: 1002
CallcenterConfigurationImpl(BasicEObjectImpl).eGet(EStructur alFeature,
boolean) line: 994
CallcenterConfigurationImpl(BasicEObjectImpl).eGet(EStructur alFeature) line:
989
NonLoadingEContentsEList<E>.create(EObject, boolean) line: 48
JPOXResource(StoreResource).getNonResolvingContent(EObject) line: 807
StoreResource$2.getChildren(Object) line: 794
StoreResource$2(AbstractTreeIterator<E>).next() line: 142
JPOXResource(StoreResource).setAllowNotifications(boolean) line: 823
JPOXResource(StoreResource).save(Map<?,?>) line: 353
The original instance of the list is loaded via a call to eIsSet(int) for
the feature. Here is the stacktrace:
EListWrapper<E>(PersistableEList<E>).load() line: 207
EListWrapper<E>.load() line: 805
EListWrapper<E>(PersistableEList<E>).delegateIsEmpty() line: 376
EListWrapper<E>(DelegatingEList<E>).isEmpty() line: 241
CallcenterConfigurationImpl.eIsSet(int) line: 406
CallcenterConfigurationImpl(BasicEObjectImpl).eIsSet(EStruct uralFeature)
line: 1225
EContentsEList$ResolvingFeatureIteratorImpl<E>(EContentsEList$FeatureIteratorImpl <E>).hasNext()
line: 427
LiveValidationContentAdapter(EContentAdapter).setTarget(EObj ect) line: 222
To me it seems that the PersistableEList simply implements a lazy loading
scheme and setAllowNotifications() is not aware of this fact.
Cheers,
Florian
--
Florian Hackenberger
|
|
|
Re: No notifications for changes to model objects after saving a JpoxResource [message #615992 is a reply to message #115845] |
Wed, 26 March 2008 17:06 |
Martin Taal Messages: 5468 Registered: July 2009 |
Senior Member |
|
|
Yes the NonLoadingEContentsEList should be used here. What I don't yet
understand is why the StateManagerImpl.isLoaded call replaces the list, afaics it should re-use the
one which is already present, it should consider the field as being loaded.
Can you enter a bugzilla for this? Then I'll pick it up in the next build (this weekend).
gr. Martin
DI Florian Hackenberger wrote:
> Martin Taal wrote:
>> It seems that the issue is related to the loaded member of the
>> persistableelist.
> It certainly is if the use of NonLoadingEContentsEList is correct.
>
>> A few questions:
>> is the loaded member of the epersistableelist also false before
>> saveResource(options) is called? so the contents of the persistableelist
>> is really loaded (it should be as the notifications flag of its content is
>> set to false)?
> It is set to true before hitting save and set to false afterwards.
>
>> During save no notifications should be sent out, however it is a bug if
>> the notification flag is not repaired afterwards.
>>
>> If the loaded flag is set to false during the saveResource, then if you
>> can debug where this happens then it is probably easy to solve.
> It is not actually set to false. A new instance of EListWrapper is generated
> for the structural feature when
> List<?> list = (List<?>) eObject.eGet(eref);
> is called in NonLoadingEContentsEList::create(EObject, boolean) after the
> call to saveResource(options). The new instance has its attribute loaded
> set to false, because JPOXArrayList::isLoaded() returns false and therefore
> the load() method of EListWrapper is not invoked in the constructor
> EListWrapper(StateManager, String, List<E>)
>
> Here is the stack trace:
> EListWrapper<E>.<init>(StateManager, String, List<E>) line: 137
> EListWrapper<E>.<init>(StateManager, String) line: 105
> EListMapping.createWrapper(StateManager, String, List<?>) line: 190
> EListMapping.newWrapper(StateManager, String) line: 59
> EListMapping.postFetch(StateManager) line: 223
> FetchRequest.execute(StateManager) line: 228
> ClassTable.fetch(StateManager, AbstractPropertyMetaData[]) line: 2552
> RDBMSManager(StoreManager).fetch(StateManager, int[]) line: 959
> StateManagerImpl.loadNonDFGFields(int[]) line: 1734
> StateManagerImpl.isLoaded(PersistenceCapable, int) line: 2034
> CallcenterConfigurationImpl.jdoGetelements(CallcenterConfigu rationImpl)
> line: not available
> CallcenterConfigurationImpl.getElements() line: 164
> CallcenterConfigurationImpl.eGet(int, boolean, boolean) line: 328
> CallcenterConfigurationImpl(BasicEObjectImpl).eGet(EStructur alFeature,
> boolean, boolean) line: 1002
> CallcenterConfigurationImpl(BasicEObjectImpl).eGet(EStructur alFeature,
> boolean) line: 994
> CallcenterConfigurationImpl(BasicEObjectImpl).eGet(EStructur alFeature) line:
> 989
> NonLoadingEContentsEList<E>.create(EObject, boolean) line: 48
> JPOXResource(StoreResource).getNonResolvingContent(EObject) line: 807
> StoreResource$2.getChildren(Object) line: 794
> StoreResource$2(AbstractTreeIterator<E>).next() line: 142
> JPOXResource(StoreResource).setAllowNotifications(boolean) line: 823
> JPOXResource(StoreResource).save(Map<?,?>) line: 353
>
> The original instance of the list is loaded via a call to eIsSet(int) for
> the feature. Here is the stacktrace:
> EListWrapper<E>(PersistableEList<E>).load() line: 207
> EListWrapper<E>.load() line: 805
> EListWrapper<E>(PersistableEList<E>).delegateIsEmpty() line: 376
> EListWrapper<E>(DelegatingEList<E>).isEmpty() line: 241
> CallcenterConfigurationImpl.eIsSet(int) line: 406
> CallcenterConfigurationImpl(BasicEObjectImpl).eIsSet(EStruct uralFeature)
> line: 1225
> EContentsEList$ResolvingFeatureIteratorImpl<E>(EContentsEList$FeatureIteratorImpl <E>).hasNext()
> line: 427
> LiveValidationContentAdapter(EContentAdapter).setTarget(EObj ect) line: 222
>
> To me it seems that the PersistableEList simply implements a lazy loading
> scheme and setAllowNotifications() is not aware of this fact.
>
> Cheers,
> Florian
--
With Regards, Martin Taal
Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
|
|
| |
Goto Forum:
Current Time: Fri Mar 29 09:55:28 GMT 2024
Powered by FUDForum. Page generated in 0.03799 seconds
|