tags:

views:

188

answers:

1

I have a .net web page which displays a list of objects. I also have a WCF service which allows clients to submit new objects. This is all glued together via SQL Server.

My question is: I would like to have the page update asynchronously when a new object is inserted via the service. Can you suggest a best practice for doing this? I would like to avoid polling the database, and the service and page don't seem to share a Cache.

Thanks!

A: 

The best practice is to use the persistent store (a.k.a. database) for this kind of thing.

The SOA world is advocating statelessness - your WCF service shouldn't have to keep some state anywhere, other than in the persistent store designed for that - the database.

Using the database, you could easily set up a "change notification" from the database, so that your page gets notified when its underlying data has changed, so it can update itself. Search for SQL Server Change Notification and you should find lots of samples and tutorials on how to do that.

marc_s