Subject | Re: Send event to client after row edit ? |
---|---|
Author | Raúl Alberto Valencia Najarro |
Post date | 2004-02-24T00:54:39Z |
Hi, Yossi.
You could do the following:
* Create a TIMESTAMP column in your table. set it to
CURRENT_TIMESTAMP when you create it and every time you change it.
* In the client application, when activating 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 timestamp column is major or equal to the saved timestamp value
* In the same code, update the variable to the server's date and
time. This assures that when the event is caught again, only the
records that changed since the last event catch.
This 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).
You can accelerate the queryes by creating an index on the column
that holds the timestamp value.
Cheers.
Raúl
You could do the following:
* Create a TIMESTAMP column in your table. set it to
CURRENT_TIMESTAMP when you create it and every time you change it.
* In the client application, when activating 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 timestamp column is major or equal to the saved timestamp value
* In the same code, update the variable to the server's date and
time. This assures that when the event is caught again, only the
records that changed since the last event catch.
This 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).
You can accelerate the queryes by creating an index on the column
that holds the timestamp value.
Cheers.
Raúl
> Hi.there
>
> On the client side I run an application with customers list with
> balances,customer row
> I want to notify all the clients when some client updates the
> in the Database, I only want to notify the clients that a specificrow was
> updated, when the client will get the event that one row wasupdated it will
> query the database for this row only so I will not have to run theall
> query again and fetch all the rows (That is what I do today, I PostEvent in
> the After Update trigger my clients gets the event and refresh theall view,
> but this takes alot of time and network traffic)
>
> Thanks
> Yossi.