Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » EMF/GWT: Resolving non-Containment references (How to update the resources to get the latest version)
EMF/GWT: Resolving non-Containment references [message #798034] Tue, 14 February 2012 06:36 Go to next message
Pasquale Gervasi is currently offline Pasquale GervasiFriend
Messages: 12
Registered: July 2010
Junior Member
Hi Everyone,

I have a problem with retrieveing the latest version of a non-containment reference which is stored in a different resource - datastore:/resource1/non-containmentref.

I have a frontend app, not the editor, that creates its own singleton ResourceSet which is used to create a resource and read in a parent object, using resource.getResource.

The latest version of the non-containment reference, held by the parent which is stored in datastore:/resource1/parentobj is correctly retrieved when ResourceSet is created the first time.

If I modify the non-containment ref, using the editor, and then execute another user session of my frontend app it always gives me the version read on the first pass.

I tried Ecore.ResolveAll(resourceSet) with no success. The only thing that works is creating a new ResourceSet for each user session.

Pasquale
Re: EMF/GWT: Resolving non-Containment references [message #798264 is a reply to message #798034] Tue, 14 February 2012 12:58 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33142
Registered: July 2009
Senior Member
Pasquale,

I'm not sure I understand the workflow. When you say you modify
something with the editor, you're implying you also save this result
back to the data store? If you have existing resource sets that have
already loaded their contents, you'd need to unload those resources and
load them again. Nothing will automatically update the resources with
new contents...


On 14/02/2012 7:36 AM, Pasquale Gervasi wrote:
> Hi Everyone,
>
> I have a problem with retrieveing the latest version of a
> non-containment reference which is stored in a different resource -
> datastore:/resource1/non-containmentref.
>
> I have a frontend app, not the editor, that creates its own singleton
> ResourceSet which is used to create a resource and read in a parent
> object, using resource.getResource.
> The latest version of the non-containment reference, held by the
> parent which is stored in datastore:/resource1/parentobj is correctly
> retrieved when ResourceSet is created the first time.
>
> If I modify the non-containment ref, using the editor, and then
> execute another user session of my frontend app it always gives me the
> version read on the first pass.
> I tried Ecore.ResolveAll(resourceSet) with no success. The only thing
> that works is creating a new ResourceSet for each user session.
> Pasquale
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: EMF/GWT: Resolving non-Containment references [message #798611 is a reply to message #798264] Tue, 14 February 2012 22:33 Go to previous messageGo to next message
Pasquale Gervasi is currently offline Pasquale GervasiFriend
Messages: 12
Registered: July 2010
Junior Member
Hi Ed,

Yes, with the editor I save the results in the datastore. I thought by using getResource I would automatically load the latest version. Assuming resourceSet is a singleton within a frontendcontroller, are you saying that:

1. rs = resourceSet.getResource(someURI,true)
2. rs.unload()
3. rs.load(null)

Will load the latest content?

Pat
Re: EMF/GWT: Resolving non-Containment references [message #798862 is a reply to message #798611] Wed, 15 February 2012 06:47 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33142
Registered: July 2009
Senior Member
Pat,

Yes, a resource's contents are loaded only once the first time and don't
change until you take action like this.


On 14/02/2012 11:33 PM, Pasquale Gervasi wrote:
> Hi Ed,
>
> Yes, with the editor I save the results in the datastore. I thought
> by using getResource I would automatically load the latest version.
> Assuming resourceSet is a singleton within a frontendcontroller, are
> you saying that:
>
> 1. rs = resourceSet.getResource(someURI,true)
> 2. rs.unload()
> 3. rs.load(null)
>
> Will load the latest content?
>
> Pat


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:EMF Serialization on XMI
Next Topic:Binding: List (want first Element) in Feature Path
Goto Forum:
  


Current Time: Sat Apr 27 03:45:39 GMT 2024

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

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

Back to the top