Disable lazy loading?

Is it possible to completely turn off lazy loading? I’ve had so many problems now already with lazy loading, that I think I would prefer to turn it off entirely and go back to the “CUBA way” of doing it…

I reported most of them and they become fixed gradually, I appreciate that, but I need a stable application, and those errors are not the easiest to debug usually…

You cannot turn off lazy loading.
But how it affects you if you just use fetch plans everywhere in the “CUBA way”?

I removed the fetch plans, because with the fetch plans (I did not use _instance_name, only _base and _local) I got the “unfetched attribute” and “Unable to access value holder” error (see https://github.com/Haulmont/jmix-data/issues/99#issuecomment-1039941965) and at first glance it looked like Jmix works best, with no fetch plans used - at least for the editor screens where database performance usually is no issue.

Then I stumbled accross the issue mentioned in Lazy loading bug with composition - #2 by krivopustov where you already posted an answer. So back to fetch plans in the editor. :wink: I tried to remove as much @JmixProperty as possible and also removed some @DependsOnProperties - which seems to make the situation better, although that means, I can’t use these attributes directly in the screen descriptors for example.

It seems some of these problems could be solved by being able to have jmix properties that are transient and therefore ignored during data operations. See also the discussion here: Exception saving an entity in DataContextImpl.mergeCommitted() - #4 by klaus

Maybe my original post was a bit “emotional”, I’m sorry for that. With the change to Jmix I so much hoped I would never see the unloved “Unfetched attribute” error ever again - but I do. :wink: And it seems I stumble across the “unfetched attribute” error in addition to the “value holder” error more than before.

I understand your frustration, but let’s try to be more specific.

https://github.com/Haulmont/jmix-data/issues/99#issuecomment-1039941965 - we are unable to reproduce it, could you provide a scenario?

Lazy loading bug with composition - #2 by krivopustov - we’ll try to fix the issue with Kotlin collections.
As for required fetch plans in editors with nested data containers - I don’t think it’s a problem, but we can probably create a fetch plan automatically if it’s absent in screen XML: https://github.com/Haulmont/jmix-ui/issues/789

Exception saving an entity in DataContextImpl.mergeCommitted() - #4 by klaus - fixed in upcoming v1.2, along with similar issues on saving complex editors.

We appreciate your feedback, it’s always very valuable. Please send us bugreports and we’ll do our best to improve the framework.

I understand your frustration, but let’s try to be more specific.

I agree.

we are unable to reproduce it, could you provide a scenario?

Yes, I will try to create a minimum test project. Actually I did try it right now, but was not successful, so maybe it’s a bug in my actual application (if that’s the case I’m sorry for the false alarm) or I’m missing something that triggers the bug. I will keep you updated if I find something.

As for required fetch plans in editors with nested data containers - I don’t think it’s a problem, but we can probably create a fetch plan automatically if it’s absent in screen XML

That’s ok as it is I think, I was just unaware that the fetch plan is also responsible for the initial data context. In hindsight it’s logical though. :wink:

Ok, awesome, looking forward to it!

1 Like