Important Notice - Forums is archived
To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.
JPACachingEntityProvider LazyLoadingException
I'm triyng to use Cached provider but got LazyLoadingException, the use case is the following:
My ComplexObject has some simple properties (say. Title, Description, EndDate, etc.) and some @OneToMany collection properties (say. Documents)
- first I show to the user a list (Table) of my Objects, on the table I get only some simple properties (Title, Desciption)
- when the user select an itema and open detail form to edit it, on the form all properties should be showned, here I got the LazyLoadingException.
I thought about using two providers,
one cached for table and another uncached for the form,
but then I should notify changes of the item from the first to the second provider,
is this the way to do or is there a smarter way ?
Regards
Another option I found is to disable cache before open form and reenable after the form is opened, like this
provider.setCacheEnabled(false);
open(new ComplexObjectForm( ((JPAContainer<T>) getContainerDataSource()).getItem(getValue()) ));
provider.setCacheEnabled(true);
but I don't know if this is a correct way anyway.
Please suggest me your opinion.
Yes I solved, the problem was that I acces property directly and not as descibed into Vaadin Book:
The default implementation works so that whenever a lazy property is accessed through the Vaadin Property interface