你的位置:首页 > ASP.net教程

[ASP.net教程]Springmvc + mybatis + spring 配置 spring事务处理

今天配置了半天,发现,事物不起效果,主要出现如下错误:

复制代码
org.mybatis.spring.transaction.SpringManagedTransaction] - [JDBC Connection [[email protected]] will not be managed by SpringSqlSession [[email protected]] was not registered for synchronization because synchronization is not activeClosing non transactional SqlSession
复制代码

 

后台看到大象的博文才找到答案,意思就是要排出spring [email protected],不然会导致事物配置失效,[email protected]

复制代码
Spring MVC启动时的配置文件,包含组件扫描、url映射以及设置freemarker参数,[email protected]设置?因为servlet-context.复制代码

 

 

 

复制代码
1 <!-- 定义控制器注解扫描包路径,控制器注解为 @Controller ,[email protected] -->2   <context:component-scan base-package="com.teshehui.product">3     <context:include-filter expression="org.springframework.stereotype.Controller" type="annotation" />4     <context:exclude-filter type="annotation" expression="org.springframework.stereotype.Service"/>5   </context:component-scan>
复制代码