I have a problem that when root transaction scope dispose the nested completed transactions scopes not rolled back. I need to rollback all nested transaction scopes when dispose the root.
the root scope from the root wcf service
using (var ts = new TransactionScope(TransactionScopeOption.Required,
new TransactionOptions() { IsolationLevel = IsolationLevel.ReadUncommitted, Timeout = new TimeSpan(0, 10, 0) },
TransactionScopeAsyncFlowOption.Enabled))
{
try
{
//logic ... and call the inner scope
ts.Complete();
return result;
}
catch (Exception ex)
{
ts.Dispose();
throw ex;
}
}
the nested scope in another wcf service
using (var ts = new TransactionScope(TransactionScopeOption.Required,
new TransactionOptions() { IsolationLevel = IsolationLevel.ReadUncommitted, Timeout = new TimeSpan(0, 10, 0) },
TransactionScopeAsyncFlowOption.Enabled))
{
try
{
//logic
ts.Complete();
return result;
}
catch (Exception ex)
{
ts.Dispose();
throw ex;
}
}
I need when the root scope disposed as a result of exception, roll back all inner transaction scopes