Refreshing Grid Data at Vaadin 8

Hi, I have a data provider that fetches data from database and I’m keeping my data at a list as you can see it below here.

List<Person> myList= new ArrayList<>(dao.getAllPersons()); ListDataProvider<Person> dataProvider = new ListDataProvider<>(myList); //... grid.setDataProvider(dataProvider); When I delete some data from my database it doesn’t refresh immediately. I have to refresh my page to see the difference.

dao.deletePerson(...); dataProvider.refreshAll();
doesn’t work at all. How can I refresh it?

dude? are you working with LazyLoading???
on JPA or MyBatis…

I dont know LazyLoading very good to be honest. I’m using Hibernate.

Have you try this ?

dao.deletePerson(...); myList.delete(...); // the person dataProvider.refreshAll(); dataProvider.refreshAll() will only refresh the grid data from myList and myList didn’t change.

EDIT: You have some examples here:!/thread/15200984

Solved it: