oracle session,Mybatis集成日志與ehcache

 2023-10-08 阅读 26 评论 0

摘要:0:集成日志1、導入log4j-1.2.17.jar包1、在src目錄下編寫log4j.xml文件一:回顧MyBatis的緩存技術1、緩存技術是一種“以空間換時間”的設計理念,利用內存空間資源來提高數據檢索速度的有效手段之一1、Mybatis的緩存1、SqlSessionFactory是引用級緩存(關閉

0:集成日志

1、導入log4j-1.2.17.jar包

1、在src目錄下編寫log4j.xml文件

Mybatis集成日志與ehcache

Mybatis集成日志與ehcache

一:回顧MyBatis的緩存技術

1、緩存技術是一種“以空間換時間”的設計理念,利用內存空間資源來提高數據檢索速度的有效手段之一

1、Mybatis的緩存

1、SqlSessionFactory是引用級緩存(關閉)

Mybatis集成日志與ehcache

1、SqlSession獲取會話(事務級緩存)

Mybatis集成日志與ehcache

2、使用二級緩存需要開啟

Mybatis集成日志與ehcache

二:ehcache緩存

1、導入JAR包

oracle session?1、ehcache-core-2.6.11核心包

2、mybatis-ehcache-1.1.0集成包

Mybatis集成日志與ehcache

2、ehcache.xml文件(默認名)

1、在src目錄下創建ehcache.xml文件

2、在src目錄下導入ehcache.xsd提示文件

Mybatis集成日志與ehcache

3、ehcache.xml編寫

1、diskStore硬盤存儲

1、編寫dtd約束

Mybatis集成日志與ehcache

java new thread,2、path="":指定目錄地址

Mybatis集成日志與ehcache

3、defaultCache默認緩存

4、cache使用的緩存

Mybatis集成日志與ehcache

Mybatis集成日志與ehcache

4、在Mybatis中的mapper映射文件

1、加上使用Ehcache緩存

Mybatis集成日志與ehcache

三:測試

Mybatis集成日志與ehcache

1、查詢語句只執行一條

Mybatis集成日志與ehcache

Mybatis集成日志與ehcache

版权声明:本站所有资料均为网友推荐收集整理而来,仅供学习和研究交流使用。

原文链接:https://hbdhgg.com/3/130173.html

发表评论:

本站为非赢利网站,部分文章来源或改编自互联网及其他公众平台,主要目的在于分享信息,版权归原作者所有,内容仅供读者参考,如有侵权请联系我们删除!

Copyright © 2022 匯編語言學習筆記 Inc. 保留所有权利。

底部版权信息