[jboss-user] [JBoss Cache: Core Edition] - Re: basic question on starting a jboss cache

bstansberry@jboss.com do-not-reply at jboss.com
Thu Mar 27 07:32:36 EDT 2008


For the Hibernate 2nd level cache case, how this works depends on what implementation of the org.hibernate.cache.CacheProvider interface you specify when you set the hibernate.cache.provider_class property in you Hibernate config.

If you use the most common one, org.hibernate.cache.TreeCacheProvider, that class will parse your config file, instantiate your cache and start it for you.

You tell Hibernate the resource path to your cache config file by setting the hibernate.cache.provider_configuration_file_resource_path property.  There's also a deprecated hibernate.cache.tree_cache.config property that does the same thing.

There's also a org.hibernate.cache.JndiBoundTreeCacheProvider that looks up your cache in JNDI.  If you use that, you're responsible for instantiating and starting your cache yourself and getting it bound into JNDI.

If you are running in JBoss AS with the 'all' config you can also specify org.jboss.ejb3.entity.TreeCacheProviderHook.  The package name implies it only works for EJB3 entities, but it should work fine for plain Hibernate usage as well.  That one works by finding a running cache in JMX.  You get the cache running by  naming your "cache-config.xml" file "something-service.xml" and deploying it.  You then add the hibernate.treecache.mbean.object_name property to your Hibernate config and use it to specify the ObjectName of your cache.

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

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



More information about the jboss-user mailing list