[jboss-user] [JBoss Seam] - Problem with cache config in unit tests

endremr do-not-reply at jboss.com
Wed Oct 31 04:01:52 EDT 2007


Hi!

I have a Seam application (v1.2.1) where I have started to use JBoss Cache as an entity cache. The application is deployed within JBoss 4.0.4, and things seems to work. I use the following config in "persistence.xml":


  |   <persistence-unit name="NewsAdminSesamNoDatabase">
  |     <provider>org.hibernate.ejb.HibernatePersistence</provider>
  |     <jta-data-source>java:/NewsAdminSesamNoDS</jta-data-source>
  |     <properties>
  |       <!-- Uses JBoss Cache as entity cache. -->
  |       <property name="hibernate.cache.provider_class" value="org.jboss.ejb3.entity.TreeCacheProviderHook"/>
  |       <property name="hibernate.treecache.mbean.object_name" value="jboss.cache:service=EJB3EntityTreeCache"/>
  |       <!-- Enabled query cache. -->
  |       <property name="hibernate.cache.use_query_cache" value="true"/>
  |     </properties> 
  |   </persistence-unit>
  | 

The problem is that my tests now breaks because I can't manage to get things running in the embedded jboss. Usually I use ehcache in my tests using the provider class "HashtableCacheProvider", defined in "default.persistence.properties".

But the TreeCache config in "persistence.xml" seems to override my test config. I have tried to include jboss-cache in my test classpath, but then my tests fail since "EJB3EntityTreeCache" is not deployed, and I don't know how I can do this.

Anybody that can give me an advice how to solve this?

Thanks :)

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

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



More information about the jboss-user mailing list