如果外部事务范围未完成,内部事务范围会回滚吗? [英] Will an inner transaction scope roll back if the outer transaction scope doesn't complete?

查看:70
本文介绍了如果外部事务范围未完成,内部事务范围会回滚吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个交易范围,一个在另一个范围内.我很想知道内部事务范围在提交后,外部事务范围未完成之后是否会回滚.

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.

推荐答案

由于它们是嵌套的,因此内部事务将回滚.

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.

本文深入探讨了 TransactionScope ,并且应该回答您的大多数问题.

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

是否分发无关紧要.

这篇关于如果外部事务范围未完成,内部事务范围会回滚吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆