The Artima Developer Community
Sponsored Link

Java Community News
What are Your Hibernate Cache Preferences?

3 replies on 1 page. Most recent reply: May 5, 2007 12:05 AM by Ari Zilka

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 3 replies on 1 page
Frank Sommers

Posts: 2642
Nickname: fsommers
Registered: Jan, 2002

What are Your Hibernate Cache Preferences? Posted: Apr 18, 2007 4:12 PM
Reply to this message Reply
Summary
EhCache is often used as Hibernate's second-level cache, but many other caching options are also available for Hibernate applications. What distributed second-level cache do you prefer to use with Hibernate?
Advertisement

As Matt Raible notes in his latest blog post, as of Hibernate 3.2, EhCache is no longer Hibernate's default second-level cache, due to some incompatibilities between the most recent, distributed version of EhCache and its older siblings.

In his blog post, Raible lists a few other caching options available to Hibernate applications, such as OSCache, noting that:

I've used OSCache in the past. It worked well, but it was kind of annoying that I had to patch Hibernate to make it work. The Hibernate folks say it's OSCache's fault, the OSCache guys say it's Hibernate's fault—so this issue will likely never get resolved...

That leaves JBoss TreeCache, EhCache and OSCache as choices for a clusterable 2nd-level cache. OSCache is an invalidating cache, which definitely works—but might not work as you expect it to. JBoss Cache only seems to allow a replicated cache which also works. EhCache seems to support both. I don't know if invalidating or replicating is better, but I imagine replicating can get quite chatty if you're dealing with large amounts of data.

But wait—is there another open source option? According to Terracotta's CTO, Terracotta is much faster than JBoss Cache. However, if you read about it ... you'll see that JBoss Cache has no "official" benchmarks.

Raible only lists open-source cache solutions, noting that possibly the best solution may be Tangosol's Coherence, which is proprietary.

What is your experience with the various distributed second-level caches for Hibernate? What distributed cache do you prefer?


Ari Zilka

Posts: 8
Nickname: ikarzali
Registered: Jul, 2006

Re: What are Your Hibernate Cache Preferences? Posted: Apr 19, 2007 7:52 AM
Reply to this message Reply
Terracotta is OSS and also works, FYI. Its not yet perfectly bundled to be honest, but people have it working, nonetheless.

Cameron Purdy

Posts: 186
Nickname: cpurdy
Registered: Dec, 2004

Re: What are Your Hibernate Cache Preferences? Posted: May 1, 2007 4:33 AM
Reply to this message Reply
> Raible only lists open-source cache solutions, noting
> that possibly the best solution may be Tangosol's
> Coherence, which is proprietary.

Coherence, as it is today, works with Hibernate out-of-the-box, but it is not always the best solution, because Hibernate doesn't always take full advantage of the capabilities that Coherence offers.

On the other hand, we are working on changing that, including adding some cache strategies to Hibernate, and then Coherence will almost always be the best solution for clustered caching with Hibernate :-)

Peace,

Cameron Purdy
http://www.tangosol.com/

Ari Zilka

Posts: 8
Nickname: ikarzali
Registered: Jul, 2006

Re: What are Your Hibernate Cache Preferences? Posted: May 5, 2007 12:05 AM
Reply to this message Reply
> Terracotta is OSS and also works, FYI. Its not yet
> perfectly bundled to be honest, but people have it
> working, nonetheless.



Here is the proof supporting my original claims (warning...the link is directly to a PDF containing a use case analysis of the performance delta):

http://www.terracotta.org/confluence/download/attachments/12545/TerracottaTreeCache.pdf?version=1

Flat View: This topic has 3 replies on 1 page
Topic: NHibernate 1.2 Brings Java O/R Mapping Framework to .NET 2.0 Previous Topic   Next Topic Topic: Vincent Partington's Enterprise Application Performance Problems Top 10

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use