are there any alternative to transactionScope which does not need to enable DTC??
In the transaction I need to make two operations:
- Create one user (using membership – sql membership provider)
- Do one insert operation.
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.
TransactionScope uses the LTM – Lightweight Transaction Manager in .Net. Only if you open more than one connection in the same transaction or go between databases, should TransactionScope promote the transaction to the 2PC-based TX-manager, DTC.
For MS SQL Server 2008 and above, the DTC will become involved only if you are opening connections to different DBs. OR if you are opening connections in the same transactions from multiple threads EXCEPT if you are using
DependentTransactionwhich is what you should enlist in your global transaction if you want to do threading.As a side-point: I have some support for the multi-threading story in Castle.Transactions.
Side-point #2: If you use TransactionScope, make sure to declare the IsolationLevel explicitly otherwise you’re serializing all your transactions (IsolationLevel.Serializable)!