Is grid data provider refresh asyncrounous ?

Debbugging my coda I noticed that when I do the refreshAll() in my data provider data are note queryed from the DB ad the code goes on.
Then I see the query executed but in the stack I don’t see nor my refreshAll() operation nor any other part of my code.
Is the refresh asynchronous ?
Is there a callback point after the data refresh I can use to synchronize my code ?
Tks

Nobody can answer or help ?
Tks

Yes. Only the page shown on the client side is queried. So the data is not refreshed when the server method is called but later.

If you can share an example and/or explain your need then perhaps we can find a way to do why it’s unexpected.

this method addDataProviderListener(…) may help you. you can find some explanation here ( for vaadin 8 but it is still viable ) https://vaadin.com/forum/thread/16920294/grid-listener-after-data-refresh-vaadin-8

My need is :
refreshAll();
select(getFirstItem());
I tried the suggested DataProviderListener and I added it to my DataProvider but onDataChange is never called nor before nor after the database access.
I use a CallBackDataProvider, does it matter ?
Tks

To select the firstElement in a Callback provider you can check this thread:

https://vaadin.com/forum/thread/17677296/grid-selected-row

Tks for Your kind help.
I elaborate Your idea and it seems to work.
Anyway migrating from Vaadin 8, a rock solid java/server centric application development environment, to a Vaadin 14, a cucumbersome javascript/client application framework I found the last one worse than the previous one from my perspective of java programmer.
Tks again

Tullio Bettinazzi:
Tks for Your kind help.
I elaborate Your idea and it seems to work.
Anyway migrating from Vaadin 8, a rock solid java/server centric application development environment, to a Vaadin 14, a cucumbersome javascript/client application framework I found the last one worse than the previous one from my perspective of java programmer.

Sorry to hear that. In this case (select a first row once the grid is rendered), the inner problem is how the dataprovider was written. It’s hard for the developer to have some simple information (next row, first row, …). There are some ongoing changes in the API and you can see these progress in a blog post: https://vaadin.com/blog/data-binding-to-grid-gets-easier-and-more-efficient