Fork me on GitHub

Mybatis中的缓存

缓存:mybatis中默认开启一级缓存
sqlSession.clearCache(); 清除缓存
<cache/> 开启二级缓存
<cache type="org.apache.ibatis.cache.impl.PerpetualCache"
size="1024"
eviction="LRU"
flushInterval="120000"
readOnly="false"
/>

//开启全局缓存
<settings>
<setting name="CachingExecutor" value="true"/>
</settings>

posted @ 2024-03-16 22:40  一名狗书匠&  阅读(2)  评论(0编辑  收藏  举报

asd