Subject | Re: [firebird-support] Send event to client after row edit ? |
---|---|
Author | Markus Ostenried |
Post date | 2004-02-24T09:14:53Z |
At 20:16 Monday, 23.02.2004 +0200, Yossi Zaig wrote:
IBObjects uses: get this techinfo
(http://www.ibobjects.com/docs/ti_dmlcaching.ZIP) and read especially the
chapter "Implementing the Additions to the Database".
The idea is to create one table named "DMLCache" in your db that will hold
all DML operations you want to get notified of, it contains records like
these (I = Insert, U = Update, D = Delete):
ID_DML | KeyField | KeyValue | Action
---------------------------------------------------------------
1 | ID_Customer | 9 | 'I'
2 | ID_Customer | 5 | 'D'
3 | ID_Customer | 9 | 'U'
These records get inserted by triggers in your other tables, i.e. the
"Customer" table.
An after-insert trigger for table DMLCache will post a single event named
i.e. "DMLCache_Ev".
In your client app you register the event and remember the last read ID_DML
value. Then when the event is fired you just get the latest records from
the DMLCache table and process them as necessary. These records will tell
you exactly what has been changed.
HTH,
Markus
>I am using FB 1.5 RC 9 / D7 / FIBPlus.Even if you're using FIBPlus you can use the DMLCache mechanism that
>
>Is it possible to Post event that will notify the client that a specific row
>was updated, so the client will refresh this row only ?
IBObjects uses: get this techinfo
(http://www.ibobjects.com/docs/ti_dmlcaching.ZIP) and read especially the
chapter "Implementing the Additions to the Database".
The idea is to create one table named "DMLCache" in your db that will hold
all DML operations you want to get notified of, it contains records like
these (I = Insert, U = Update, D = Delete):
ID_DML | KeyField | KeyValue | Action
---------------------------------------------------------------
1 | ID_Customer | 9 | 'I'
2 | ID_Customer | 5 | 'D'
3 | ID_Customer | 9 | 'U'
These records get inserted by triggers in your other tables, i.e. the
"Customer" table.
An after-insert trigger for table DMLCache will post a single event named
i.e. "DMLCache_Ev".
In your client app you register the event and remember the last read ID_DML
value. Then when the event is fired you just get the latest records from
the DMLCache table and process them as necessary. These records will tell
you exactly what has been changed.
HTH,
Markus