views:

1185

answers:

6

We are looking at implementing a caching framework for our application to help improve the overall performance of our site.

We are running on Websphere 6.1, Spring, Hibernate and Oracle. The focus currently is on the static data or data that changes very little through out the day but is used a lot.

So any info would be great. I have started my google search and reading but wanted to get a feel for what has worked for members of the community. One of the things that we are interested in is the ability to have the system invalidate the cache when a change does happen in the underlining data.

Thanks

Update:

I came across an article on the IBM web site where it says that Hibernate's Cluster aware caches in conjunction with WebSphere Application Server has not been determined yet; therefore, is is not yet determined whether or not their use is supported.

Thoughts on that? We are running in a clustered environment.

+2  A: 

Well the hibernate cache system does just that, I used ehCache effectively and easily with Hibernate (and the second level cache system).

Lucene could be an option too depending on the situation. Hibernate Search or Compass could help with that (although it might take some major work).

Replication using Terracotta could also be an option although I've never done it.

Loki
+1  A: 

Hibernate has first and second level caching built in. You can configure it to use EhCache, OSCache, SwarmCache, or C3P0 - your choice.

duffymo
A: 

I've used ehCache and OSCache and found OSCache to be easier to configure and use.

Owen
+1  A: 

This is very close to this question.

cletus
+1  A: 

You can also leverage WebSphere's default cache i.e. DynaCache to implement the second level cache. This will allow you to administer, monitor and configure your cache leveraging WebSphere caching infrastructure

Rohit Kelapure
A: 

One of the things that we are interested in is the ability to have the system invalidate the cache when a change does happen in the underlining data.

From what I can see, Hibernate doesn't actually do the above - from Hibernate's docs:

Be careful. Caches are never aware of changes made to the persistent store by another application (though they may be configured to regularly expire cached data).

Obviously what it means is that a cache doesn't have ESP, and can't tell if an app not in the cluster has called straight DML on the database - but I am guessing that what you want is an ability to expose a service for legacy apps to hook in and invalidate the cache when they do update that data. And there isn't, to my knowledge, a suggestion about how this might be done.