Quantcast
Channel: Visual C# forum
Viewing all articles
Browse latest Browse all 31927

What is the recovery path for TransactionInDoubtException ?

$
0
0

Can somebody tell me what is the proper way to handle TransactionInDoubtException

and roll back partial commits?

var option = new TransactionOptions();
option.IsolationLevel = IsolationLevel.ReadCommitted
using (var scope = new TransactionScope(TransactionScopeOption.Required, option))
{
    try
    {
         Context.SaveEmail(_emailInfoList);
         context.SaveSyncState(syncState);
         scope.Complete();
         return true;
    }
    catch (TransactionInDoubtException ex)
    {
         // Looks like commit has already taken place 
         // How to roll back the changes ??
         // sth like scope.Rollback()
    }
}



Viewing all articles
Browse latest Browse all 31927

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>