springMVC+mybatis+ehcache缓存配置实践
1.引入包(复制到lib_项目右键,properties_Java Build Path_Libraries_Add JARs..选择项目Lib文件夹下的包)
ehcache-core-2.4.6.jar
mybatis-ehcache-1.0.1.jar

<!-- 开启二级缓存 -->
<setting name="cacheEnabled" value="true"/>
3.配置业务Mapper(xxxMapper.xml)
<!-- 开启缓存 带日志输出-->
<cache type="org.mybatis.caches.ehcache.LoggingEhcache"/>
<!-- 刷新缓存 -->
ehcache-core-2.4.6.jar
mybatis-ehcache-1.0.1.jar
<!-- 开启二级缓存 -->
<setting name="cacheEnabled" value="true"/>
3.配置业务Mapper(xxxMapper.xml)
<!-- 开启缓存 带日志输出-->
<cache type="org.mybatis.caches.ehcache.LoggingEhcache"/>
<!-- 刷新缓存 -->
<insert id="myInsert" parameterType="map" flushCache="true">