Nested Transactions with TransactionScope

风格不统一 提交于 2019-11-30 20:14:27

Yes.

The inner transaction is enrolled in the same scope of the outer one, and the whole thing will rollback. This is the case, as you didn't enroll the inner transaction as a new one using TransactionScopeOption.RequiresNew.

Konamiman

See here for an explanation on this subject: http://web.archive.org/web/20091012162649/http://www.pluralsight.com/community/blogs/jimjohn/archive/2005/06/18/11451.aspx.

Also, note that the scope1.Dispose is redundant since scope1 will be automatically disposed at the end of the using block that declares it.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!