-->
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.  [ 2 posts ] 
Author Message
 Post subject: Looking for advice re. 2nd level cache implementation
PostPosted: Sun Apr 22, 2012 5:55 pm 
Newbie

Joined: Mon May 18, 2009 10:45 am
Posts: 9
After upgrading jgroups from 2.5.1 to 2.7.0GA, we encountered ClassNotFoundExceptions that we tracked down to class loader issues between swarmcache (our Hibernate 2nd level cache provider) and jgroups. To make a long story short, we’re now attempting a cut over to jboss cache.

Some specifics…

JBoss AS 5.1.0.GA (w/ Hibernate 3.3.1GA)
hibernate-jbosscache2-3.3.1.GA
jbosscache-core 3.2.5GA

With that said, here’s my hibernate configuration in which we ran into DataVersioningExceptions with queries…

<property name="hibernate.cache.use_second_level_cache" value="true" />
<property name="hibernate.cache.use_query_cache" value="true" />
<property name="hibernate.cache.region.jbc2.query.localonly" value="true" />
<property name="hibernate.cache.region.factory_class" value="org.hibernate.cache.jbc2.MultiplexedJBossCacheRegionFactory" />
<property name="hibernate.cache.region_prefix" value="hibernate.firstbest" />

With that said, I'm in serious need of advice. I've been reading these forums along with the JBoss Cache forums for the past few days and lots of other web pages and I'm unsure if this is the right approach. I have to resolve these issues asap.

Is Jboss Cache the right 2nd level cache? Is optimistic-entity the appropriate configuration? If so, how do I handle DataVersioningExceptions? Is mvcc-entity a better configuration?

What about Infinispan? Is this a better 2nd level cache implementation? is this available pre Hibernate 3.5?

EH Cache?

Please, any advice is greatly appreciate... Sincerely, Tom
Sincerely, Tom


Top
 Profile  
 
 Post subject: Re: Looking for advice re. 2nd level cache implementation
PostPosted: Mon Apr 30, 2012 3:49 am 
Expert
Expert

Joined: Tue Jun 16, 2009 3:36 am
Posts: 990
Quote:
Is Jboss Cache the right 2nd level cache?


I would say, it is the right choose if you:
- want continue to use Hibernate 3.3.1GA
- want to use transactional access strategy.
- are already using Hiberante with JTA (Java Transaction API) approach
That means you already define a TransactionManager, your Datasource is XA-ready (supports distributed transactions),
as Jboss Cache will be registered as second XA-resource.
N.B.: If your Datasource is not XA-ready, then a emergency solution could be Atomikos-TransactionManager using their last resource gambit)

Quote:
Is mvcc-entity a better configuration?


Yes, in my opinion.
It behaviour is better when transactions come to fail (on rollbacks).

Quote:
What about Infinispan? Is this a better 2nd level cache implementation? is this available pre Hibernate 3.5?


Infinispan is the official sucessor of Jboss-Cache and meanwhile surely a better cache implementation.
I think it's not available pre Hibernate 3.5.

Quote:
EH Cache?


EH Cache is the ideal solution in my opinion, if you aren't already using the JTA approach as mentioned above, or if you don't like the implications due the more complex JTA architecture (XA-resources, 2-phase commits, transaction-recovery , etc.).
EH Cache is also useable with read-write access strategy, thus it does'nt require integration with JTA as Jboss-Cache and Infinispan do.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.