Jack Lechner Messages: 8 Registered: December 2012
Junior Member
Hello-
I am in the process of migrating an existing EMF model from XML to CDO. I'm currently having a problem due to not receiving a Notification.RESOLVE at startup. Normally, the notification would be sent by the loading of the objects from the XML and this would trigger initialization methods that could only be run after the object was loaded.
After reading this post (http://www.eclipse.org/forums/index.php/m/774303/#msg_774303), I enabled load notifications on my transaction (I use a single transaction for everything). I'm not sure if it affects anything but the object I'm having a problem with is a child of the object that is retrieved from the resource. I have the adapter attached as follows (to the child) and I never receive a notification when my object is loaded.
public MyObjectImpl() {
super();
this.eAdapters().add(new Adapter() {
@Override
public void notifyChanged(Notification notification) {
// initialization code
}
});
}
Am 28.12.2012 19:39, schrieb Jack Lechner:
> Hello-
>
> I am in the process of migrating an existing EMF model from XML to CDO. I'm currently having a problem due to not
> receiving a Notification.RESOLVE at startup. Normally, the notification would be sent by the loading of the objects
> from the XML and this would trigger initialization methods that could only be run after the object was loaded.
>
> After reading this post (http://www.eclipse.org/forums/index.php/m/774303/#msg_774303), I enabled load notifications
> on my transaction (I use a single transaction for everything). I'm not sure if it affects anything but the object I'm
> having a problem with is a child of the object that is retrieved from the resource. I have the adapter attached as
> follows (to the child) and I never receive a notification when my object is loaded.
>
> public MyObjectImpl() {
> super();
> this.eAdapters().add(new Adapter() {
>
> @Override
> public void notifyChanged(Notification notification) {
> // initialization code
> }
>
> });
> }
>
> Hope you can help me out. Thanks in advance!
Took me some time to find out how the load notifications are supposed to work and I noticed that they're not being
dispatched for initial loads. I've fixed that with:
I also noticed, that TOUCH notifications are being dispatched rather than the RESOLVEs you're suggesting. Your adapters
don't seem to test for that, though.