Why multiple @ComponentScan annotations corrupt my AspectJ transaction?

夙愿已清 提交于 2019-12-08 06:09:40

问题


I'm asking this question in continue to the issue I described here.

I got some unexpected behavior when I used AspectJ transactions - some operations were immediately committed to the DB, before that transaction was ended. And therefore they were not rolled back in case of error. When I changed the Advice Mode (@EnableTransactionManagement(mode=AdviceMode.ASPECTJ)) to PROXY all was working fine.

I found out that I had multiple classes annotated with the @ComponentScan annotation, and when I removed all these annotations but one - all was working as expected!

My question is - why?

来源:https://stackoverflow.com/questions/53040111/why-multiple-componentscan-annotations-corrupt-my-aspectj-transaction

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