|Re: Strange EOpposite issue [message #1220685 is a reply to message #1220607]
||Fri, 13 December 2013 05:03
| Ed Merks
Registered: July 2009
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
> 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
Powered by FUDForum
. Page generated in 0.01642 seconds