Search code examples
c#transactionscope

Will an inner transaction scope roll back if the outer transaction scope doesn't complete?


I have two transaction scopes, one within another. I would love to know if the inner transaction scope will be rolled back after it has been committed and the outer one does not complete.


Solution

  • Since they are nested, the inner transaction will roll back.

    This is not the whole story, and depends on how you create the nested transaction, but by default, it will roll back.

    This article goes into depth about TransactionScope and should answer most of your questions.


    Being distributed or not is irrelevant.