-->
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.  [ 4 posts ] 
Author Message
 Post subject: JBoss Cache 2 as second level cache provider
PostPosted: Thu Oct 09, 2008 1:35 pm 
Newbie

Joined: Thu Oct 09, 2008 1:25 pm
Posts: 3
Hibernate version: 3.3.0 SP1

Hi all,

I'm trying to get Hibernate 3 to work using JBoss Cache 2 as the second level cache provider. According to the documentation, the provider class to specify via hibernate.cache.provider_class is org.hibernate.cache.jbc2.JBossCacheRegionFactory.

One snag with this: JBossCacheRegionFactory does not implement the CacheProvider interface, so it cannot be instantiated if configured like any other 2nd level cache provider.

Is there a different configuration mechanism when using JBoss Cache 2 as a second level cache provider with Hibernate 3, or does it plain not work?

Thanks and regards,

--doug



Code:
Caused by: org.hibernate.cache.CacheException: could not instantiate CacheProvider [org.hibernate.cache.jbc2.JBossCacheRegionFactory]
   at org.hibernate.cache.impl.bridge.RegionFactoryCacheProviderBridge.<init>(RegionFactoryCacheProviderBridge.java:66)
   ... 81 more
Caused by: java.lang.ClassCastException: org.hibernate.cache.jbc2.JBossCacheRegionFactory incompatible with org.hibernate.cache.CacheProvider
   at org.hibernate.cache.impl.bridge.RegionFactoryCacheProviderBridge.<init>(RegionFactoryCacheProviderBridge.java:63)
   ... 81 more


Top
 Profile  
 
 Post subject: Problem solved
PostPosted: Mon Oct 13, 2008 3:07 pm 
Newbie

Joined: Thu Oct 09, 2008 1:25 pm
Posts: 3
Got some help over in the JBoss Cache forum. Looks like contrary to the Hibernate documentation, you do not specify a cache provider (via hibernate.cache.provider_class) as the documentation might lead you to believe. Instead, you use the hibernate.cache.region.factory_class property, specifying a value of org.hibernate.cache.jbc2.MultiplexedJBossCacheRegionFactory.

It would be interesting to understand the decisions leading to breaking with the existing convention.


Top
 Profile  
 
 Post subject: Re: JBoss Cache 2 as second level cache provider
PostPosted: Thu May 21, 2009 12:30 am 
Newbie

Joined: Wed May 20, 2009 11:20 pm
Posts: 2
hi Doug,

could you link to the jboss thread where you got help? I've been having lots of trouble getting jboss cache working under hibernate... Mostly I'm having trouble because I keep coming across threads for older configuration options that no longer work.


Top
 Profile  
 
 Post subject: Re: JBoss Cache 2 as second level cache provider
PostPosted: Sat May 30, 2009 11:21 am 
Newbie

Joined: Sat May 30, 2009 11:16 am
Posts: 1
Check this wiki: http://www.jboss.org/community/wiki/Clu ... inJBossAS5

And more importantly, the Hibernate 3.3 and JBC 2.x "Using JBoss Cache as a Hibernate Second Level Cache reference manual." in http://www.jboss.org/jbossclustering/do ... uide-3.pdf


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

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.