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???
Malcolm
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
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