Hibernate 二级缓存 使用
来源:互联网 发布:淘宝客用手机可以做吗 编辑:程序博客网 时间:2024/05/17 21:47
// 使用 缓存
User 使用缓存
// hib.cfg.xml 缓存
启动查询缓存
// 缓存配置文件
ehcache.xml
// 再查询时候, 虽然第一次 Session 关闭了 ,但是 开启了 二级缓存: SessionFactory 级别的。
c.setCacheable(true);
再 第二次执行
l=c.list();
的时候 将不会执行hql
其执行结果如下
----------
Hibernate: select this_.id as id0_0_, this_.username as username0_0_, this_.password as password0_0_ from sys_user this_ where this_.username=?
-1-NyiiMzA7O5mT
-2-NyiiMzA7O5mT
=========================================
如果 不开启 二次缓存
c.setCacheable(false); // 默认
执行结果则如下:
--------------------------------------------
Hibernate: select this_.id as id0_0_, this_.username as username0_0_, this_.password as password0_0_ from sys_user this_ where this_.username=?
-1-NyiiMzA7O5mT
Hibernate: select this_.id as id0_0_, this_.username as username0_0_, this_.password as password0_0_ from sys_user this_ where this_.username=?
-2-NyiiMzA7O5mT
- Hibernate使用EHCache二级缓存
- hibernate二级缓存使用
- Hibernate 二级缓存 使用
- Hibernate 二级缓存使用
- Hibernate中使用二级缓存
- 使用Hibernate 二级缓存
- Hibernate二级缓存的使用
- Hibernate二级缓存使用(ehcache)
- hibernate 二级缓存的使用(转)
- 项目中使用hibernate二级缓存
- hibernate使用memcache做二级缓存
- Hibernate中二级缓存的使用
- Hibernate使用Ehcache实心二级缓存
- 使用 Hibernate 二级缓存的步骤
- Hibernate 使用ehcache配置二级缓存
- 【Hibernate】二级缓存(Hibernate默认使用的二级缓存)
- 使用JBossCache作为Hibernate的二级缓存
- Hibernate中二级缓存的配置和使用
- PHP在Apache中两种工作方式的区别(CGI模式、Apache 模块DLL)
- c++编译器和连接器介绍
- 文件的打开方式
- poj 3278 Catch That Cow(第一道广搜题,(*^__^*) 嘻嘻……)
- 2009-6-23,
- Hibernate 二级缓存 使用
- Apache配置PHP模块
- 7/10/2008,2008-4-25
- 拜访各位高手
- 2009-6-16,7/21/2008
- 我的新博客!(新作品在这里,旧博客看不到哦)
- 双分发示例
- 转: pam 禁止某些用户使用ssh 远程登录
- 【转】MFC命名