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

@DSTransactional事务失效问题 #6683

Closed
AHWH980802 opened this issue Jul 2, 2024 · 1 comment
Closed

@DSTransactional事务失效问题 #6683

AHWH980802 opened this issue Jul 2, 2024 · 1 comment

Comments

@AHWH980802
Copy link

版本号:

3.6.0

问题描述:

在多数据源的情况下,使用@DSTransactional失效,使用的DataSourceContextHolder.setDataSource(等价于DynamicDataSourceContextHolder.push)切的数据源。方法上使用注解@DSTransactional,数据源可以正常切换,但是事务不生效,报错不会回滚

错误截图:

友情提示:

  • 未按格式要求发帖、描述过于简单的,会被直接删掉;
  • 描述问题请图文并茂,方便我们理解并快速定位问题;
  • 如果使用的不是master,请说明你使用的分支;
@AHWH980802
Copy link
Author

DataSourceContextHolder.setDataSource 为什么我会自定义一个同功能的类,因为这个项目使用DynamicDataSourceContextHolder.push不成功,但是另一个又可以成功,不知道是不是哪里冲突了,所以就重新定义了一个。但是不管是哪个项目,@DSTransactional都不起作用

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