iBATIS 缓存介绍
Mov
,
2010-01-18
整理
一.缓存介绍.....................................................................................................................................2
1.1 缓存对象...............................................................................................................................2
1.2 缓存介质[保存在哪里]........................................................................................................2
1.2.1 内存............................................................................................................................2
1.2.2 硬盘............................................................................................................................2
1.2.3 数据库........................................................................................................................2
1.3 命中率...................................................................................................................................3
1.4 最大保存元素数量...............................................................................................................3
1.5 缓存更新策略.......................................................................................................................3
1.5.1 FIFO[first in first out]................................................................................................3
1.5.2 LFU[Less Frequently Used]......................................................................................3
1.5.3 LRU[Least Recently Used]........................................................................................3
1.6 本地缓存 VS 远程缓存........................................................................................................4
二.iBATIS 高速缓存介绍................................................................................................................4
2.1 iBATIS 高速缓存的关注点..................................................................................................4
2.2 iBATIS 对高速缓存管理的帮助..........................................................................................4
2.3 iBATIS 高速缓存和传统 O/RM 高速缓存的区别.............................................................5
三. 配置 iBATIS 缓存......................................................................................................................5
3.1 cacheModel 标签..................................................................................................................5
3.1.1 cacheModel 标签的属性...........................................................................................5
3.1.2 联合使用 readOnly 和 serialize 属性........................................................................6
3.2 iBATIS 高速缓存模型的类型..............................................................................................6
3.2.1 MEMORY..................................................................................................................6
3.2.2 LRU............................................................................................................................7
3.2.3 FIFO...........................................................................................................................7
3.2.4 OSCACHE.................................................................................................................7
3.2.5 自定义高速缓存模型................................................................................................7
3.3 高速缓存的清除...................................................................................................................8
3.4 设置高速缓存模式实现的特性...........................................................................................8
3.5 常见问题...............................................................................................................................8
3.5.1 如何选择 iBATIS 高速缓存模型类型......................................................................8
3.5.2 如何手工强制清除 iBATIS 高速缓存中保存的对象..............................................9
3.5.3 OSCACHE 基本使用及配置项说明........................................................................9
四. 参考资料..................................................................................................................................10