首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > J2EE开发 >

!关于ehcache缓存的有关问题

2012-05-08 
!关于ehcache缓存的问题功能是用ssh+ehcache做的使用查询缓存后1)select * from s where id1select * fro

!关于ehcache缓存的问题
功能是用ssh+ehcache做的

使用查询缓存后
1)
select * from s where id=1

select * from s where id=1

select * from s where id=1

调用dao层查询方法3次,第二次,第三次是从缓存中查询的。就查了一次数据库。

2)
select * from s where id=1

select * from s where id=2

select * from s where id=3

这样就查3次数据库

求解决


[解决办法]
先 select * from s

然后
select * from s where id=1

select * from s where id=2

select * from s where id=3

是查询多少次数据库?

热点排行