| |
| Publicado el 10,marzo 2016 - 14:38 |
I need to run a procedure in every client whenever a new record is inserted in the database (the record is not inserted by the client).
I know for HFSQL C/S you can use 'Server triggers'. But not for MSSQL. Now I run a query every minute to see if there is a change but I need to have 'no latency' and running this procedure from every client every second will increase the load too much (WAN access).
What would be the best practice to do this?
Cheers,
Adri |
| |
| |
| | | |
|
| | |
| |
| Publicado el 10,marzo 2016 - 16:22 |
| |
| |
| | | |
|
| | |
| |
| Publicado el 10,marzo 2016 - 17:33 |
| It looks like 'event notifications' is only for database-level actions (create table, add column, add index etc, but not for insert/update/delete data within the table). |
| |
| |
| | | |
|
| | |
| |
| Publicado el 16,marzo 2016 - 13:31 |
Try using sockets.
When your clients start the app, have them register in a table. When they add/edit a record send a notification to the socket server. Have a separate thread in your app waiting for socket updates.
Theres a demo socket app that will help you |
| |
| |
| | | |
|
| | |
| |
| Publicado el 16,marzo 2016 - 13:54 |
The best option is to solve this at the mssql level. One option is to use xp_cmdshell in one mssql trigger to run your program. Be careful with all the security, performance and maintenance problems.
If you need to solve it at WD level you will always have some delay, if the problem is to run it from every client why don't you create one service an run it only at server level. |
| |
| |
| | | |
|
| | |
| |
| Publicado el 16,marzo 2016 - 19:35 |
Hello Adri
As the source of the change is your Windev application, you could overload the HAdd command with your own and pick up the change there.
Regards Al |
| |
| |
| | | |
|
| | |
| |
| Publicado el 17,marzo 2016 - 13:51 |
Thanks all for your responses. Will do some testing and post the results here.
Cheers, Adri |
| |
| |
| | | |
|
| | |
| |
| Publicado el 17,marzo 2016 - 14:30 |
Hello Adri,
why not simply use hversion?
Best regards |
| |
| |
| | | |
|
| | |
| |
| Publicado el 17,marzo 2016 - 14:49 |
Hi Fabrice,
As far as I know HVersion doesn't support OLEDB nor Native Access. We use MSSQL so it looks like HVersion won't help.
Cheers,
Adri |
| |
| |
| | | |
|
| | |
| |
| Publicado el 17,marzo 2016 - 14:54 |
Adri, The records are inserted by your app or by some external one that you can't control?
When you say "the record is not inserted by the client" how they are inserted?
As far as i can understand the key to your problem is how the records are inserted and what you want to do with it. |
| |
| |
| | | |
|
| | |
| |
| Publicado el 17,marzo 2016 - 15:12 |
Hi Paulo,
The records are inserted via another application. It is a WinDev Application Server that receives events via a socket and processes these to an alert. When a new alert is created the clients needs to be informed without delay.
We have a web client, there we can show the alert right away. We have an app and there we can also push the alert. But we also have a Windows client. There we can show the alert only after running a query on the table. Doing that for all clients will result in an unacceptable load. So there is our challenge.
The second change we need to push around is when clients (Web, App and Windows) change the status of an alert record.
We also have multiple user groups working in the same database but not sharing he same records. So changes on table level cannot be pushed to all users. We need to do this after evaluating which user group needs to be alerted.
Cheers, Adri |
| |
| |
| | | |
|
| | |
| |
| Publicado el 17,marzo 2016 - 15:21 |
Hi Adri,
I checked and you are right... well, the funny thing is that it the help says clearly that it IS supported, but the remarks indicate that in OLEDB and native Access, the value returned (there IS one) is always zero.... Now that's a funny one...
Best regards |
| |
| |
| | | |
|
| | |
| |
| Publicado el 17,marzo 2016 - 17:03 |
if everything is on the same machine (service, webdev server and windev clients) you can use Shared memory zones for the notification process.
If you need to exchange messages between several machines you can use MSMQ or develop something using sockets. |
| |
| |
| | | |
|
| | |