Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » [Texo] Save proxy
[Texo] Save proxy [message #1170177] Mon, 04 November 2013 13:05 Go to next message
Bastian Wagenfeld is currently offline Bastian Wagenfeld
Messages: 162
Registered: January 2013
Senior Member
Hi Martin,

I've got a problem regarding the proxy resolving. My model looks like this.

- House
- Room
- Door

Now I load a house from my database with one child level. So the house is resolved, but its child Room is an eProxy (which is what I want). If I change the Houses name and save the resource (resource.save(new HashMap<>()), the Room doesn't contain the Door anymore.

Is there a standard method to prevent Texo from saving Proxy objects, because this will set the object's fields to null?

Best regards
Bastian
Re: [Texo] Save proxy [message #1170213 is a reply to message #1170177] Mon, 04 November 2013 13:32 Go to previous messageGo to next message
Martin Taal is currently offline Martin Taal
Messages: 5339
Registered: July 2009
Senior Member
Hi Bastian,
Hmm what goes wrong on the server, is a new Room object maybe created on the server?

gr. Martin

On 11/04/2013 02:05 PM, Bastian Wagenfeld wrote:
> Hi Martin,
>
> I've got a problem regarding the proxy resolving. My model looks like this.
>
> - House
> - Room
> - Door
>
> Now I load a house from my database with one child level. So the house is resolved, but its child Room is an eProxy
> (which is what I want). If I change the Houses name and save the resource (resource.save(new HashMap<>()), the Room
> doesn't contain the Door anymore.
> Is there a standard method to prevent Texo from saving Proxy objects, because this will set the object's fields to null?
>
> Best regards
> Bastian


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@xxxxxxxx - mtaal@xxxxxxxx
Web: www.springsite.com - www.elver.org
Re: [Texo] Save proxy [message #1172927 is a reply to message #1170213] Wed, 06 November 2013 06:58 Go to previous messageGo to next message
Bastian Wagenfeld is currently offline Bastian Wagenfeld
Messages: 162
Registered: January 2013
Senior Member
Hi,

I wasn't able to reproduce this. So I think this was a problem in my software, sorry.
Thank you for your fast response anyway Smile

Bastian
Re: [Texo] Save proxy [message #1174702 is a reply to message #1172927] Thu, 07 November 2013 09:10 Go to previous messageGo to next message
Bastian Wagenfeld is currently offline Bastian Wagenfeld
Messages: 162
Registered: January 2013
Senior Member
Hi Martin,

it's me again... The topic is different from the original post, but I thought this topic might also fit.
So here is my use case: At system start I load some objects and the children (and so on) into the resource. There might be about 500 EObjects in the resource. I create a tree in my RCP and if a special object is loaded, its sub-object (which can have around 1000 children) should be reloaded from the database.
So what would be the best approach to fetch the mentioned object with all of its children as fast as possible? Proxyresolving itself was not the best approach, because it visits each object. So there are 1000 server requests. So I create a query (select i from test_Test i where i.id = 1) to fetch the object and execute the query in the JSONTexoResource. This works fine, but the eProxy-URI isn't removed. So EMF visits als children, although they are already filled.
Is this the right behaviour? Or as a workaround: How could I remove the proxy-URI manually?

Best regards
Bastian
Re: [Texo] Save proxy [message #1174823 is a reply to message #1174702] Thu, 07 November 2013 10:35 Go to previous messageGo to next message
Bastian Wagenfeld is currently offline Bastian Wagenfeld
Messages: 162
Registered: January 2013
Senior Member
Ok, this might be a little hard to understand, so here are some additions:
The object I reload via the query references (not contains) objects that have already been loaded at system start. The EMF-object I want to reload already references the whole object which was already resolved at the system start. But the proxy URI of the reference is set anyway.

I hope this is understandable at all...

Bastian
Re: [Texo] Save proxy [message #1176400 is a reply to message #1174823] Fri, 08 November 2013 10:02 Go to previous messageGo to next message
Martin Taal is currently offline Martin Taal
Messages: 5339
Registered: July 2009
Senior Member
Hi Bastian,
Okay, to get some better idea, so when loading these proxies are they resolved against already loaded objects, but the
only thing is that the proxy is not unset? or
is the proxy not resolved against already loaded objects?

gr. Martin

On 11/07/2013 11:35 AM, Bastian Wagenfeld wrote:
> Ok, this might be a little hard to understand, so here are some additions:
> The object I reload via the query references (not contains) objects that have already been loaded at system start. The
> EMF-object I want to reload already references the whole object which was already resolved at the system start. But the
> proxy URI of the reference is set anyway.
>
> I hope this is understandable at all...
> Bastian


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@xxxxxxxx - mtaal@xxxxxxxx
Web: www.springsite.com - www.elver.org
Re: [Texo] Save proxy [message #1184039 is a reply to message #1176400] Wed, 13 November 2013 07:19 Go to previous messageGo to next message
Bastian Wagenfeld is currently offline Bastian Wagenfeld
Messages: 162
Registered: January 2013
Senior Member
Hi Martin,

sorry for that late answer. You are right, the proxies are not resolved against already loaded objects. Most of the objects are retrieved during startup, but some of the objects are to large to fetch them as well. So they are reloaded by click. This object references other objects that have already been loaded. In debug-mode for example, I can see that they are set correctly, but there proxy URIs aren't unset.
I solved this by setting all URIs null. So no proxies are resolved. This is ok, because there is only one place where this happens, till now.

Best regards
Bastian
Re: [Texo] Save proxy [message #1185756 is a reply to message #1184039] Thu, 14 November 2013 08:44 Go to previous messageGo to next message
Martin Taal is currently offline Martin Taal
Messages: 5339
Registered: July 2009
Senior Member
No Problem Bastian! I have been looking at it further. Could the following be happening:
- large objects are loaded at startup
- other objects are loaded at click, their json contains proxy-references to the other large objects
- the reference to the other objects is correctly resolved but as the json contains a proxy uri, the proxy uri is set in
the large-already-loaded object

So before the click-load the proxy uri of the large-already-loaded object is not set, after the click-load the large
objects have their proxy uri set.

Can you check/debug if you see this (or something else)?
(at least looking at the code this could happen)

gr. Martin

On 11/13/2013 08:19 AM, Bastian Wagenfeld wrote:
> Hi Martin,
>
> sorry for that late answer. You are right, the proxies are not resolved against already loaded objects. Most of the
> objects are retrieved during startup, but some of the objects are to large to fetch them as well. So they are reloaded
> by click. This object references other objects that have already been loaded. In debug-mode for example, I can see that
> they are set correctly, but there proxy URIs aren't unset. I solved this by setting all URIs null. So no proxies are
> resolved. This is ok, because there is only one place where this happens, till now.
> Best regards Bastian


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@xxxxxxxx - mtaal@xxxxxxxx
Web: www.springsite.com - www.elver.org
Re: [Texo] Save proxy [message #1187578 is a reply to message #1185756] Fri, 15 November 2013 07:07 Go to previous messageGo to next message
Bastian Wagenfeld is currently offline Bastian Wagenfeld
Messages: 162
Registered: January 2013
Senior Member
Hi Martin,

yes, that's right. The objects loaded at startup aren't very large, but rather small. The objects loaded by click are the large objects, but the process itself is like you described it.
An object loaded at startup is completely resolved and has no uri set. It has no reference on the lazily loaded object but the other way round the click-loaded has a reference on it. So the object gets loaded by a query. Afterwards the lazy object has no uri set, but the startup-object gets an uri.

Best regards and thank you!
Bastian
Re: [Texo] Save proxy [message #1191024 is a reply to message #1187578] Sat, 16 November 2013 22:44 Go to previous messageGo to next message
Martin Taal is currently offline Martin Taal
Messages: 5339
Registered: July 2009
Senior Member
Hi Bastian,
I published a new build which should solve this, can you try it?

gr. Martin

On 11/15/2013 08:07 AM, Bastian Wagenfeld wrote:
> Hi Martin,
>
> yes, that's right. The objects loaded at startup aren't very large, but rather small. The objects loaded by click are
> the large objects, but the process itself is like you described it. An object loaded at startup is completely resolved
> and has no uri set. It has no reference on the lazily loaded object but the other way round the click-loaded has a
> reference on it. So the object gets loaded by a query. Afterwards the lazy object has no uri set, but the startup-object
> gets an uri.
>
> Best regards and thank you!
> Bastian


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@xxxxxxxx - mtaal@xxxxxxxx
Web: www.springsite.com - www.elver.org
Re: [Texo] Save proxy [message #1195882 is a reply to message #1191024] Tue, 19 November 2013 06:20 Go to previous message
Bastian Wagenfeld is currently offline Bastian Wagenfeld
Messages: 162
Registered: January 2013
Senior Member
Hey Martin,

seems to work now, but I could just have a glance at it. Thank you for your help Smile

Best regards!
Bastian
Previous Topic:[Teneo] Override teneo.jpa annotation while runtime
Next Topic:HOW do you Query for multiple values with Texo/JSON REST Web Services
Goto Forum:
  


Current Time: Thu Oct 23 01:43:15 GMT 2014

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

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