Nested Transaction Scope .net
I'm using SQL Server 2008 R2 and trying to use transactions. First a question about transactions in .net and SQL Server. If I have something like this try { var transactionOpti
Solution 1:
If you want to recover from a failure in a transactional context you need to use transaction savepoints. Unfortunately the managed System.Transaction has no support for savepoints. Not only that, but you won't be able to use savepoints, even directly, if you use transaction scopes, because the transaction scope will escalate to distributed transactions and savepoints do not work in distributed contexts.
You can use instead the platform specific SqlTransaction which supports Save() for savepoints. See Exception Handling and Nested Transactions for an example of transaction-aware exception handling.
Post a Comment for "Nested Transaction Scope .net"