-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: ehcache query caching problem.
PostPosted: Thu Jun 15, 2006 3:13 am 
Beginner
Beginner

Joined: Fri Sep 16, 2005 7:51 am
Posts: 25
Hi there !

I have a strange probleme using a query cache with ehcache.

I have declared a cache region in ehcache.xml which I want to use:

<cache name="queryCache.ItemDAO.getAllSimpleItems"
eternal="false"
overflowToDisk="false"
timeToIdleSeconds="300"
timeToLiveSeconds="600"
/>


And declared (using annotations) a query to be cached :

@NamedQuery(name="query.ItemDAO.getAllSimpleItems",
query="from SimpleItem",
hints = {@QueryHint(name = "org.hibernate.cacheable", value = "true"),
@QueryHint(name = "org.hibernate.cacheRegion", value = "queryCache.ItemDAO.getAllSimpleItems"),
@QueryHint(name = "org.hibernate.timeout", value = "100"),
@QueryHint(name = "org.hibernate.fetchSize", value = "1"),
@QueryHint(name = "org.hibernate.flushMode", value = "Commit"),
@QueryHint(name = "org.hibernate.cacheMode", value = "NORMAL"),
@QueryHint(name = "org.hibernate.comment", value = "Return all items.") } )

With this configuration, query result is never cached ( I activated debug log and controlled the trace).
IF I change the QueryHint "org.hibernate.cacheRegion" to name another cache region, ie "testRegion", then the cache works !

Obviously, if I use a cache region name declared in ehcache, things won't work...

Did I missed something ?

Thanks for your help,

sne.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.