Spring MySQL 本地事物配置后不生效

本地事物配置后不生效可能有不少状况。我在配置出现的问题java

1,MySQL存储引擎是不是InnoDB。web

2,项目配置时。在web.xml中配置spring

<context-param>
		<param-name>contextConfigLocation</param-name>
		<param-value>
			classpath*:/spring-mongo.xml
			classpath*:/spring-mybatis.xml 
		</param-value>
	</context-param>
	<listener>
		<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
	</listener>

发现上面配置的在项目中事物不生效。 而后改在spring-mvc.xml中引入spring-mvc

<import resource="spring-mybatis.xml"/>  
<import resource="spring-mongo.xml"/>

配置的本地事物就能够生效了。mybatis

相关文章
相关标签/搜索