我试图将两个 TransactionScopes 包装在另一个 TransactionScope 中,但是当我运行程序并且在第二个事务范围内触发错误时,第一个事务不会回滚。是否可以回滚两者,或者我最好做点别的事情。由于表中的 TransactionScope 锁定行并且无法正常工作,我不得不将它们分开。
Using objTransaction As New Transactions.TransactionScope(Transactions.TransactionScopeOption.RequiresNew, New TimeSpan(0, 10, 0))
Using objTransaction As New Transactions.TransactionScope(Transactions.TransactionScopeOption.RequiresNew, New TimeSpan(0, 10, 0))
'Scope - 1
End Using
Using objTransaction As New Transactions.TransactionScope(Transactions.TransactionScopeOption.RequiresNew, New TimeSpan(0, 10, 0))
'Scope - 2
End Using
End Using