[jboss-user] [JBoss Cache Users] - Re: JBoss 4.2.2 with TreeCache 1.4.1.SP5: nodes, attributes

the_olo do-not-reply at jboss.com
Wed Sep 23 07:25:40 EDT 2009


OK, I've found the solution to my problem.

First, it wasn't in the configuration of the TreeCache itself, but of the Hibernate Cache provider.

It turns out that this behaviour is by design the default in the Hibernate JBoss Cache provider (hibernate-jbc-cacheprovider-1.0.1.GA.jar).

See: http://www.jboss.org/community/wiki/NewJBossCache14xBasedHibernate32CacheProvider.

The option responsible for this behaviour is hibernate.treecache.local_puts_only:

anonymous wrote : The aim of this property, whose default value is true, is to makes sure any put calls on the Second Level Cache as a result of a read operation from the database are done locally which means that data read from database is not replicated to other nodes.

So placing the following line in my hibernate.cfg.xml has enabled full cache replication across the cluster:

        <property name="hibernate.treecache.local_puts_only">false</property>
  | 

The relevant portion of my Hibernate session factory configuration now looks like this:

        <property name="hibernate.cache.provider_class">org.jboss.hibernate.jbc.cacheprovider.JmxBoundTreeCacheProvider
  |                         </property>
  |         <property name="hibernate.treecache.mbean.object_name">jboss.cache:service=MyTreeCache</property>
  |         <property name="hibernate.treecache.local_puts_only">false</property>
  |         <property name="hibernate.cache.use_second_level_cache">true</property>
  |         <property name="hibernate.cache.use_query_cache">false</property>
  |       
  |         <!-- Tuning -->
  |         <property name="hibernate.jdbc.batch_size">32</property>
  |         <property name="hibernate.jdbc.fetch_size">32</property>
  |         <property name="hibernate.default_batch_fetch_size">32</property>
  |         <property name="hibernate.jdbc.batch_versioned_data">true</property>

View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4256600#4256600

Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4256600



More information about the jboss-user mailing list