Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Strange EOpposite issue(Proxies are not correctly resolved)
Strange EOpposite issue [message #1220607] Thu, 12 December 2013 16:57 Go to next message
Jens Rabe is currently offline Jens RabeFriend
Messages: 81
Registered: September 2013
Member
Moved here: http://www.eclipse.org/forums/index.php/t/628327/

It seems to be an Xtext problem because with XMI the resolving works after accessing the proxy once.

[Updated on: Thu, 12 December 2013 18:48]

Report message to a moderator

Re: Strange EOpposite issue [message #1220685 is a reply to message #1220607] Fri, 13 December 2013 05:03 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33140
Registered: July 2009
Senior Member
Jens,

Comments below.

On 12/12/2013 5:57 PM, Jens Rabe wrote:
> I have two objects, A and B. A has a single-valued reference to B, B
> has a multi-valued reference to A. The references are set as
> EOpposites (A.b is EOpposite to B.a and vice-versa).
>
> Now, there is a VERY strange problem:
>
> I load A from a resource set. This gives me my A, and A.b points to a
> B which is a proxy. B.a points to A. Everything is OK for now.
>
> However, I now access the B. The proxy B is resolved to B' which is
> the real object.
>
> My expectation would now be:
> A.b points to B', B'.a points to A.
No, the proxy at each of the ends resolves independently.
>
> But what happens is:
>
> A.b points to B', B'.a points to a NEW proxy A',
It points at the same proxy it was pointing at before.
> and A'.b points to B' again.
With bidirectional references the proxy always points back...
> When I now call the B'.a, the proxy A' is resolved to a "real" object
> A'', whereas A''.b
What's A''?
> points to a new proxy B'',
No proxies are created during proxy resolution.
> and so forth. If I traverse this, I can go an endless path of
> incorrectly resolved objects.
>
> What is going wrong here?
It's not entirely clear from your description how many resources are
involved. But here's what I expect. If A is in resource X and B is in
resource Y you'll have loaded A where A.b references a proxy Bp. When
you access A.b, resource Y is loaded, and like for X, B.a references a
proxy Ap; Bp is resolved to B an A.b will reference B, but B.a
references Ap until you access B.a, at which point it resolves to A. If
you're seeing something different, look closely at how many resources
are involved in the resource set. Perhaps there is some inconsistency
in the proxy URIs so that when you access B.a, a third resource is being
loaded. If not, there should be at most two As and two Bs (in each
case, on the "real" object the other a proxy) in the specific scenario
your describe.


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Strange EOpposite issue [message #1220725 is a reply to message #1220685] Fri, 13 December 2013 09:52 Go to previous message
Jens Rabe is currently offline Jens RabeFriend
Messages: 81
Registered: September 2013
Member
Hi,

thanks for your hints, but I solved it on my own, your other answer on saving dependent resources got me there. My answer is in the other thread because the cause for this strange behaviour was incorrectly used Xtext functionality.
Previous Topic:[Texo] EDataType and Texo
Next Topic:Refreshing EMF resources through a byte[]
Goto Forum:
  


Current Time: Tue Apr 23 11:23:51 GMT 2024

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

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

Back to the top