Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [CDO] Adapter does not receive RESOLVE notification
[CDO] Adapter does not receive RESOLVE notification [message #994966] Fri, 28 December 2012 18:39 Go to next message
Jack Lechner is currently offline Jack LechnerFriend
Messages: 12
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
	}			
			
  });
}


Hope you can help me out. Thanks in advance!
Re: [CDO] Adapter does not receive RESOLVE notification [message #995145 is a reply to message #994966] Sat, 29 December 2012 07:19 Go to previous message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
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:

397232: Load notification missing for initial load
https://bugs.eclipse.org/bugs/show_bug.cgi?id=397232

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.

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper


Previous Topic:No Model exporter found for Xcore
Next Topic:Locking Mechanism in CDO
Goto Forum:
  


Current Time: Fri Apr 19 06:23:31 GMT 2024

Powered by FUDForum. Page generated in 0.01840 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top