开发者

Handling lost connection with client inside a .NET webservice - possible?

I have written a webservice which calls a procedure in database and returns this procedure's results as a DataSet. Is there any way to know (inside this webservice) if the connection with client was lost while returning data? I'd like to ha开发者_如何学编程ndle this situation rolling back any changes i made to my db. Any help appreciated.


As I understand your question you want to ensure that your client gets back the data from your service as only in that case you want to commit some changes to the database. That is possible only if client initiates distributed transaction, your service joins the transaction and then when client receives data he commits the transaction.

This is supported in WCF (transaction flow). ASMX web services doesn't support this interaction - in such case you must manually control MSDTC transaction.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜