Battle of the X-panes now free on hulu.com# Aviation - 航空航天
c*n
1 楼
I enabled ehcache as second level cache,
from TRACE level logging, I can see that hibernate/ehcache did try to place
query result/load result into cache, but every time I query with the same
parameter (i.e. there is only one uniq query), so it says
"caching xxx ..."
"xxx is already cached",
this is fine.
but it seems that after trying to read from the cache for only 1 time, it
never tries to use the cache again.
I can see on the first read, it logs:
2011-12-20 15:29:53,344 95419 INFO [org.hibernate.cache.StandardQueryCache]
[http-8080-2][] starting query cache at region: org.hi
bernate.cache.StandardQueryCache
2011-12-20 15:29:53,348 95423 DEBUG [org.hibernate.cache.StandardQueryCache]
[http-8080-2][] checking cached query results in regio
n: org.hibernate.cache.StandardQueryCache
but this never appears again.
so why is it not using the cache?
I did set the properties in hibernate.cfg.xml, and used setCacheable() and
setRegion() in my session.createQuery().list()
thanks
from TRACE level logging, I can see that hibernate/ehcache did try to place
query result/load result into cache, but every time I query with the same
parameter (i.e. there is only one uniq query), so it says
"caching xxx ..."
"xxx is already cached",
this is fine.
but it seems that after trying to read from the cache for only 1 time, it
never tries to use the cache again.
I can see on the first read, it logs:
2011-12-20 15:29:53,344 95419 INFO [org.hibernate.cache.StandardQueryCache]
[http-8080-2][] starting query cache at region: org.hi
bernate.cache.StandardQueryCache
2011-12-20 15:29:53,348 95423 DEBUG [org.hibernate.cache.StandardQueryCache]
[http-8080-2][] checking cached query results in regio
n: org.hibernate.cache.StandardQueryCache
but this never appears again.
so why is it not using the cache?
I did set the properties in hibernate.cfg.xml, and used setCacheable() and
setRegion() in my session.createQuery().list()
thanks