No notifications for changes to model objects after saving a JpoxResource [message #615984] |
Wed, 26 March 2008 11:23 |
Florian Hackenberger Messages: 123 Registered: July 2009 |
Senior Member |
|
|
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
--
Florian Hackenberger
|
|
|
Powered by
FUDForum. Page generated in 0.01559 seconds