Using SqlDependency in Web Servive Context

Hi:

Can SqlDependency be used in a stateless model such as web services

Thanks,

Duy



Answer this question

Using SqlDependency in Web Servive Context

  • Scott Vande Krol

    I would recommend the ASP.NET Web Services forum for this question (http://forums.microsoft.com/msdn/ShowForum.aspx ForumID=46).

    From what I understand (I haven't tried it and would double check with the experts in the mentioned forum), but SqlDependency inherently needs the state of the result set to be maintained. This allows the application to be notified that the data has changed and that it needs to update it's cache.

    When a call to a stateless web service is made the objects created during the call are marked for garbage collection at the end. The lifetime of the object is limited to the scope of the method call. You could extend the lifetime by adding the object to the cache. However, that implies enabling state/caching. If you did so, you'll need to evaluate the scope of the cache if you have a Web farm scenario.

    Hope that helps,
    Anand

    PS: If you find a solution please post an update, I'd be interested too. Smile

  • anil_m_s

    Thanks for your reply.

    After reading this article (http://msdn.microsoft.com/library/default.asp url=/library/en-us/dnvs05/html/querynotification.asp) - I would like you to clarify something for me:

    "You can write a query notification client in ADO.NET as we'll be doing, using OLE DB, or even using the new HTTP Web service client, but a point to remember is that query notifications are only available through client-side code."

    Does the 'new' refer to the new Indigo web service

    Thanks.

  • Badekapp

    Your question is related to ASP.NET Web services and SQL Server Query Notifications. I would recommend posting your question on ASP.NET Web services forum and/or the SQL Server Data Access forum.

    This forum is focused on SQL Server Notification Services (SQL-NS). I agree the names can be confusing. SQL-NS (in a nutshell) is a platform based on the pub-sub model of gathering "external" events and deliver customized notifications through various different delivery channels like email, SMS, etc. This is probably not what you're looking for.

    Hope you find the right people to answer your question.

    Regards,
    Anand

  • Using SqlDependency in Web Servive Context