问题
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