Proxy.Available is True, but Accessing Value will fire Request...

I have a Field like this:

FEntityList: Proxy<TList>;

FEntityList.Available returns True, but FEntityList.Value will fire Select. (as my SQL-Monitor is telling me...)




That is not possible. If the value is available, it will not load the proxy.

Stepping into GetAvailable,

FLoaded = False, but
FController = nil

because, there is no controller assigned, it returns true...

Correct. And if controller is not assigned, there is absolute no information to load the proxy, thus no SQL is executed.

But if I access FEntityList.Value, my list is fetched and contains all records...

Ok, this happens, because my Field is proxy, but my Attribute ManyValuedAssociation is not "Lazy"...
After setting this attribute to lazy this works as you suggested in this thread.

Means my datas are not loaded anymore.
But these data exists...

1 Like

Finally, I understood what is happening.

I put my Proxy into another abstracted class, that will handle fetching my datas in an optimized way.
At this point my Proxy does not have the controller at all.
The controller is assigned later on, so that's why my copy of the proxy does not work as expected...

1 Like

That is an interesting feature I think.
By doing this, List will never be loaded, but could be used for appending new Entities.
You can also fetch single entities, that would be in this list and add them to list

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.