Question

I wanted to implement Vaadin Server push so that changes on the server DB are pushed to users. For example, if User A saves to the server DB, then User B should see the change automatically on his UI.

However, the Vaadin book states that:

The SQLContainer keeps continuously checking the amount of rows in the connected database table in order to detect external addition or removal of rows. By default, the table row count is assumed to remain valid for 10 seconds. This value can be altered from code; with setSizeValidMilliSeconds() in SQLContainer.

So does this mean that i dont need to implement server push for server db changes?

Will the SQLContainer also check for row updates?

I believed the reason for server push was to push data changes to users?

Was it helpful?

Solution

No, it only checks the row count. You can see that at the source code of SQLContainer's size() and updateCount() methods. Pushing each DB change to users via push is not a common practice, because it does not scale well. You can put a refresh button to update the container's data or poll the DB for changes periodically, by using the Refresher addon. (https://vaadin.com/directory#addon/refresher)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top