Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

关于TxTransaction事物失效的疑问,望指点一二 #6

Open
lijianfx opened this issue Aug 15, 2018 · 0 comments
Open

关于TxTransaction事物失效的疑问,望指点一二 #6

lijianfx opened this issue Aug 15, 2018 · 0 comments

Comments

@lijianfx
Copy link

lijianfx commented Aug 15, 2018

你好,我是初学者,在参考demo springcloud-lcn-mybatis编写案例时,出现TxTransaction事物失效的现象:服务A调用服务B,服务B插入数据后,服务A因为异常导致数据保存失败,此时服务B没有回滚。最后比较代码发现没有在服务A、B的启动类中添加如下代码:
image
如果服务B启动类中不添加上图中的代码,服务B是可以正确保存数据入库,说明上图中的代码是非必须的。
请问缺少这部分代码为什么会导致TxTransaction事物失效?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant