在这段代码中..
public static TransactionScope CreateTransactionScope(bool createNew = false)
{
return new TransactionScope(
createNew ? TransactionScopeOption.RequiresNew : TransactionScopeOption.Required,
new TransactionOptions() { IsolationLevel = IsolationLevel.ReadCommitted });
}
其实在这一...
using (TransactionScope rootScope = CreateTransactionScope())
{
using (TransactionScope nestedOne = CreateTransactionScope())
{ nestedOne.Complete(); }
using (TransactionScope nestedTwo = CreateTransactionScope(true))
{ nestedTwo.Complete(); }
// No committing, rollback 'rootScope'.
}
哪些事务将与根事务一起回滚 - 将是唯一的nestedOne
还是两者nestedOne
兼而有之nestedTwo
?