posted 13 years ago
Ehcache is commonly used to cache the results of database queries: for example, it's frequently used as the second level cache for Hibernate. It's easily plugable, has lots of configuration options (region sizes, overflow to disk, time to live, time to idle, eviction strategy, etc.), can be extended (self-populating caches) and clustered with Terracotta.
As far as I know, Oracle Coherence can be used too, but in that case I hope you wouldn't use it only as a local cache, since Ehcache easily provides the same service for free.