Are there any transactions around multiple webservice calls?

这一生的挚爱 提交于 2019-12-25 01:26:01

问题


A few days ago I asked this question in stackoverflow and ASP.net forums. the answer which I got was "No, this is not possible. Transactions cannot go past web service boundaries" Are there any transactions around multiple webservice calls?

but in ASP.net forum I got the answer below: http://jalpesh.blogspot.com/2010/05/using-transactions-with-linq-to-sql.html it's offering system.transaction. what is your suggestion about it?


回答1:


Are there any transactions around multiple webservice calls?

The answer to the above question is that in the general case it is possible to have disparate web services participate in the same transaction. To do this you would use the industry standard WS-Transaction which is part of the WS-Coordination specification. The specification of interest is WS-Atomic Transaction (WSAT).

If you are running on a Microsoft stack and have MSDTC configured properly between all machines then it is possible to pass transactions between web services (see Propagating a Transaction Across AppDomains.

So, the answer is yes, it is possible in general. However, if you are talking about incorporating transactions around arbitrary third party services (as your previous question appears to be about) then that is probably not possible because most likely those third party services do not support WSAT (and I don't blame them!).

Unfortunately, in these scenarios, the best you can hope for in the event of failure is to execute compensating actions.




回答2:


LINQ to SQL really has nothing to do with transactions around web service calls.

I remember reading about this: http://en.wikipedia.org/wiki/WS-Transaction but have no idea of the state of any of the implementations. So I won't say it can't be done, but if it is possible, based on the companies involved in the spec, it will be very expensive and very complex.



来源:https://stackoverflow.com/questions/5542946/are-there-any-transactions-around-multiple-webservice-calls

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!