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

事务失效 #8

Open
1042545965 opened this issue Jan 30, 2020 · 1 comment
Open

事务失效 #8

1042545965 opened this issue Jan 30, 2020 · 1 comment

Comments

@1042545965
Copy link

发现 ShiroConfig 这个系统配置会引起 spring 的 @transactional 声明式事务失效 。 多次测试 但是没找到具体原因

@1042545965
Copy link
Author

已经找到原因了 , 因为 Shiro 的ShiroFilterFactoryBean实现了FactoryBean接口,所以它会提前被初始化 , 在 ShiroFilter 中有注入了service 这里我没有像作者一样直接使用 mapper ,导致service 没有被spring的 容器注入 ,自然没办法使用 aop 最终导致 在使用这个 service 的声明式事务失效 。

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