开发者

Can I use TransactionScope to do distributed transaction?

I have a MVC app that uses Linq2Sql to access a SQL DB. But I want create a distributed transaction to update another DB on different local server.

I want to update both in a transaction.

Can I just wrap logic in TransactionScope class???

M开发者_StackOverflowalcolm


If your database supports using TransactionScope (Informix seems to want to use IfxTransactions) then you should be able to use the transaction across multiple databases.

You can open multiple database connections within the same transaction scope. The transaction scope decides whether to create a local transaction or a distributed transaction.

The transaction scope automatically promotes a local transaction to a distributed transaction if necessary, see this article for more details: http://www.csharpcorner.com/uploadfile/mosessaur/transactionscope04142006103850am/transactionscope.aspx

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜