spring4.0 mybaties 事务不回滚

 这个星期发现项目里面的叼事务居然不回滚想死的心都有。

我说说我的事务部回滚的原因:applicationContext 和 spring-mvc 这两个配置的文件中扫描包扫了两遍,两个东西重复了,导致事物不回滚


applicationContext 配置




这里只扫描service 的注解


spring-mvc配置


   
     


这里扫描controller 会自动的去扫描他下面子类,去掉applicationContext 扫描的 service中的注解。在加载的过程中先是加载spring-mvc 的配置 然后是加载applicationContext的配置

web的配置

 
contextConfigLocation
classpath:applicationContext.xml
 

        museum
        org.springframework.web.servlet.DispatcherServlet
       
            contextConfigLocation
            classpath:spring-mvc.xml
       

        1
   


   
        museum
        *.action
   


你可能感兴趣的:(spring,事务)