ZigiZ
ZigiZ

Reputation: 2520

Client-Server database application: how to notify clients that data was changed?

Is it possible to know when and if the contents of certain tables in a database has changed? How can my SQL Server notify the client applications that the data was changed by another user? How to implement query notifications with dbGo ?

Do my clients need to poll the database, or is there a callback mechanism for this?

My client is a Delphi application with TADODataSet, and my server is SQL Server 2005/2008, serving multiple clients.

Upvotes: 9

Views: 3655

Answers (2)

Misha
Misha

Reputation: 1826

No, you would have to build your own "middle tier" to do this. The simplest way is to poll the server. A more complex solution is to build your own "middle tier" server that polls the database and pushes notifications to the clients (with your own client connection).

A middle ground solution is to have a separate client on the server poll the tables you need to "watch" and write "notfication flags" into another database table that can be polled by the clients. At least this way the clients can poll a simple table with minimal data that lists what has changed which can then be read by another select query. A lot less effort on the part of the clients.

Upvotes: 1

Related Questions