locked
How to fire database change notification from WCF Data services to client RRS feed

  • Question

  • HI All,

    I have developed an ADO.NET Data Service which exposes my database entitites.This data service is built on top of a Entity Data Model. Now what i want is that if any change happens in my entities like addition of a record / updation from backend , client should get a notification that new record has been inserted.

    Are there any events which are fired by wcf dataservice whenever some change happens in Database entities. i know that the Entity data model entities are capable of sensing the changes happening in Db and update themselves but how to send such events from service to client.

    Please send me suggestion of any ....

    Thnks
    Chitranjan
    Tuesday, January 19, 2010 12:04 PM

Answers

  • There is no functionality in Data Services that would do this kind of notification for you - if this is a hard requirement for you, you would need to implement something to do this for you. If you think about what Data Services is (an HTTP REST based service) this type of notification from the server to the client would violate the spirit of a REST based service. It would require the service to maintain significant amounts of cross-request state that HTTP servers typically don't do.

    Shayne Burgess
    Program Manager
    Friday, February 12, 2010 12:53 AM
    Moderator

All replies

  • There is no functionality in Data Services that would do this kind of notification for you - if this is a hard requirement for you, you would need to implement something to do this for you. If you think about what Data Services is (an HTTP REST based service) this type of notification from the server to the client would violate the spirit of a REST based service. It would require the service to maintain significant amounts of cross-request state that HTTP servers typically don't do.

    Shayne Burgess
    Program Manager
    Friday, February 12, 2010 12:53 AM
    Moderator
  • As Shayne has indicated WCF Data Services does not have a Push model, you can get data out of it but not push responses to a client

    There is something called WCF callbacks. Take a look at the example here.

    http://idunno.org/archive/2008/05/29/wcf-callbacks-a-beginners-guide.aspx

    Perhaps this is something that you can use to solve this issue.

    Thanks

    Chris Robinson

    Tester


    This posting is provided "AS IS" with no warranties, and confers no rights.
    Friday, April 9, 2010 2:21 PM
    Moderator