Multiuser – Stale Data – Problem

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).

Documentation points to:

dp.setAutoUpdate(2000); 

docs.dhtmlx.com/doku.php?id=dhtm … se_concept

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:

scheduler.clearAll()
scheduler.load(urlLoad, "json");

What’s the accepted way of doing this?

I came up with a version 1 solution to the mulituser / stale data issue:

  1. Created a history table which logs all changes stamped with an sequential id
  2. Established Ajax polling, every 20-30 seconds
  3. Each polls sends the id of the history table corresponding to the browser’s current view
  4. Server checks if any there are any history records greater than the id
  5. If found, they will me either: delete, update or insert records
  6. For delete return via ajax: newHistoryId|-|scheduler.deleteEvent(eventId,true);
  7. 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…