Is UI#access global for all users?

I have an application in Vaadin that loads data asynchronously from a database. To use the loaded data afterwards, I access the UI with UI#getCurrent#access to update it, right? At the moment, the data is updated live for all logged in users, not just the one. :slightly_smiling_face:

You can read this documentation about broadcast: Server Push | Advanced Topics | Vaadin Docs

Hey, thanks for the quick reply. I have already read the docu post and then assumed that normal UI#access and @Push is suitable for me? Broadcast sounds to me like I would be able to send a message somewhere, which then arrives at all users?

My Use Case is a Grid with a list of items and after you click on button, it does some database things and then the grid should be updated, but only for the “current” user which clicked on the button :slightly_smiling_face:

Broadcast is when you want to send something to all users.
Ok, I don’t know if you edited your message or I misunderstood.
Yes, UI#access should update only one user

Do you have the code? I guess there is an issue with the Spring scope or a static value?

Oh. I think you`re right. Its a scope issue. i have an idea :smile:

Okay that works! The Service is now with the “@VaadinSessionScope:smile:

What is the safest way to access the UI? UI#getCurrent? this.getUI? Saving the ui in AttachedEvent? Sometimes i get an UIDetachedException :frowning_with_open_mouth:

GetUi is the recommended way.

Having some exceptions can be expected ( if a user just closed the browser tab for example)