-->
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: Region based caching (JBoss Cache + Hibernate)
PostPosted: Thu Feb 14, 2008 6:36 am 
Newbie

Joined: Sun Apr 15, 2007 11:10 pm
Posts: 2
Hi,

I am using JBoss cache as 2nd level cache in Hibernate.

But I am trying to use region based caching, so that cache regions of different tables refresh in different time intervals.

I have configured my settings as per below but cache is refreshing based on default region settings i.e.

Code:
<region name="/_default_">


Am I missing something?

JBoss Cache configuration (region only)

Code:
<region name="/SYSTEM_PARAMETER">
   <attribute name="maxNodes">50000</attribute>
   <attribute name="timeToLiveSeconds">7200</attribute>
   <attribute name="maxAgeSeconds">7200</attribute>
</region>   


HIbernate configuration (hbm file)

Code:
<hibernate-mapping package="com.shkco.nwte.common.datamodel">
   <class name="SystemParameter" table="SYSTEM_PARAMETER">
      <cache usage="read-only"/>
   ..
   </class>
</hibernate-mapping>



Java Code

Code:
query.setCacheable(true);
query..setCacheRegion("SYSTEM_PARAMETER");

where query if of type "org.hibernate.Query"   


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.