Subject Re: ***Corrected*** Send event to client after row edit ?
Author Raúl Alberto Valencia Najarro
[I'm sorry. I erroneously send a draft in the last message. This is
the correct version.]

Hi, Yossi.

You could do the following:

* Create a TIMESTAMP column in your table. set it to
CURRENT_TIMESTAMP when you create a record and every time you change
it.

* In the client application, when activating the listener of the
event, query the servers' date and time (using CURRENT_TIMESTAMP),
and save it to a variable, property or whatever.

* When you catch the event, query in the table all records in that
the value of the timestamp column is major or equal to the timestamp
value that you saved.

* In the same code, after querying the table, save again the server's
current date and time. This assures that when the event is caught
again, only the records that changed since the last event are
retrieved.

This method has the advantage that all the changed records are
retrieved on a single operation. It saves time and network bandwith.

Of course, you should be careful, keep the server's date and time
accurately at all times! (In the vast majority of cases, this isn't a
problem).

Cheers.

Raúl

P.D. : You can also use a generator rather than a TIMESTAMP value.
You should increment the generator on every INSERT and UPDATE, and
set the new colum's value to the generator's value. Then use the
value of the generator to query the list (column) >= (generator's
value). Doing that, you can avoid the process of taking care of the
server's date and time, and the potential errors that could happen if
it is set to a erroneous value. Things happen, and when Murphy is
hiperactive, is capable to even change a servers' clock ;-)