-1

I am working at an application in Java namely, I am trying to manipulate a database with the help of a UI. Multiple users can login in order to use the UI. Therefore each user has its own instance of the application for performing operations like inserting, deleting and updating a table from the database. When such operations are performed the corresponding tableview will be updated in order to display the new data to the user.

The requirement that I am trying to achieve is that when a user performs an operation, only the tableview from that UI is updated while the other UIs for the rest of the connected users are not updated. As a workaround for this impediment, I managed to use TimerTask for scheduling once at 30 seconds to update each table view for each connected user. Even though it was "successful", it did not solve the issue completely because of that waiting time. What I would like to do, instead of waiting for 30 seconds in order to refresh all the tableviews, I would like this to happen in real-time.

I used MySQL for creating the database. I saw that you can attach triggers to the tables from the database. I am not sure if I am wrong, but could please somebody tell me if when an operation by a user is performed, the change that will be made by that action in the database, to be reflected in all the tableviews for each connected user and not only in the UI in which the operation has been fired?

Thank you!

Josh
  • 1

1 Answers1

0

You may want to take an approach whereby each instance of this application is capable of listening for your own custom events, when an update from your TableView is triggered, you can apply these updates further.

This post on StackOverflow would be of help!