In a multiuser in environment, I’m having a problem with stale data. What’s the best way to propagate changes. User 1 and User 2 both have access to the same schedule. When User 1 adds, delete or changes an event, User 2 needs to have his screen updated.
I am using DataProcessor with custom server side code (Oracle, mod pl/sql).
How can I implement the custom server side code behind setAutoUpdate? I have a db table which stores all the events along with a last update timestamp and each event has an id, so it’s easy know which events need to be updated for each user.
I am hopeful there is a better solution than updating the entire view with:
I came up with a version 1 solution to the mulituser / stale data issue:
Created a history table which logs all changes stamped with an sequential id
Established Ajax polling, every 20-30 seconds
Each polls sends the id of the history table corresponding to the browser’s current view
Server checks if any there are any history records greater than the id
If found, they will me either: delete, update or insert records
For delete return via ajax: newHistoryId|-|scheduler.deleteEvent(eventId,true);
For update and insert return: newHistoryId|-|scheduler.parse([jason of event record])
As far as I can tell, it’s working fine. Recurring events work, even if certain days are edited.
Still not sure what dp.setAutoUpdate(2000); does…
I suppose in version 2 the ajax poll would be replaced with a server push technology. It looks today’s server push options all require the installation of special web server. Not sure the best route…
Get a guaranteed answer from DHTMLX technical support team
under the most suitable support plan