Questions tagged [ehcache]

Ehcache is an open source, standards compliant Java-based cache used to boost performance, offload the database and simplify scalability.

Ehcache is robust, proven and full-featured, which has made it the most popular Java-based cache with 100,000’s of production deployments.

It can scale from an in-process cache on one or more nodes through to a mixed in-process/out-of-process configuration capable of terabyte-sized caches. The open source Terracotta Server Array snaps in to provide a coherent distributed cache.

Ehcache is actively developed, maintained and supported as a professional open source project by Terracotta, Inc. and is available under an Apache 2 license.

For more information, see the EHCache website.

2344 questions
162
votes
6 answers

Difference between "on-heap" and "off-heap"

Ehcache talks about on-heap and off-heap memory. What is the difference? What JVM args are used to configure them?
Synesso
  • 34,066
  • 32
  • 124
  • 194
135
votes
10 answers

Spring Cache @Cacheable - not working while calling from another method of the same bean

Spring cache is not working when calling cached method from another method of the same bean. Here is an example to explain my problem in clear way. Configuration:
Bala
  • 3,907
  • 6
  • 24
  • 29
103
votes
3 answers

How to differentiate between time to live and time to idle in ehcache

The docs on ehache says: timeToIdleSeconds: Sets the time to idle for an element before it expires. i.e. The maximum amount of time between accesses before an element expires timeToLiveSeconds: Sets the time to live for an element before it…
Jacques René Mesrine
  • 41,077
  • 24
  • 60
  • 99
82
votes
6 answers

@Cacheable key on multiple method arguments

From the spring documentation : @Cacheable(value="bookCache", key="isbn") public Book findBook(ISBN isbn, boolean checkWarehouse, boolean includeUsed) How can I specify @Cachable to use isbn and checkWarehouse as key?
phury
  • 1,819
  • 1
  • 18
  • 32
76
votes
18 answers

Another unnamed CacheManager already exists in the same VM (ehCache 2.5)

This is what happens when I run my junit tests... Another CacheManager with same name 'cacheManager' already exists in the same VM. Please provide unique names for each CacheManager in the config or do one of following: 1. Use one of the…
simou
  • 2,277
  • 3
  • 22
  • 37
63
votes
2 answers

Caching with Hibernate + Spring - some Questions

I'm working on developing a web application with Spring 3 and Hibernate 3.6. At the moment I try to understand how Caching with Spring and Hibernate works. I found some sources about Caching with Hibernate and some about Spring and I try to bring my…
nano7
  • 2,395
  • 6
  • 33
  • 51
63
votes
7 answers

hazelcast vs ehcache

Question is clear as you see in the title, it would be appreciated to hear your ideas about adv./disadv. differences between them. UPDATE: I have decided to use Hazelcast because of the advantages like distributed caching/locking mechanism as well…
Javatar
  • 4,121
  • 14
  • 48
  • 64
46
votes
5 answers

Memory leak when redeploying application in Tomcat

When I redeploy my application in tomcat, I get the following issue: The web application [] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@10d16b]) and a value of type…
Raghav
  • 1,040
  • 2
  • 14
  • 33
40
votes
4 answers

Getting `Can't assign requested address` java.net.SocketException using Ehcache multicast

Getting java.net.SocketException when trying to start a multicast provider: 2013-09-11 11:45:44,204 [main] ERROR net.sf.ehcache.distribution.MulticastRMICacheManagerPeerProvider: Error starting heartbeat. Error was: Can't assign requested…
eebbesen
  • 4,760
  • 7
  • 46
  • 67
39
votes
2 answers

Using EhCache in Spring 4 without XML

Is there a way to initialize EhCache without xml in either Spring 4 or with Spring Boot? I noticed Spring Boot 1.0.0.RC3 doesn't have any ehcache dependencies but the Spring 4.0GA release post mentioned it has improved support for EhCache. Also,…
Erich
  • 2,643
  • 1
  • 22
  • 28
35
votes
2 answers

hello world example for ehcache?

ehcache is a hugely configurable beast, and the examples are fairly complex, often involving many layers of interfaces. Has anyone come across the simplest example which just caches something like a single number in memory (not distributed, no XML,…
wingnut
  • 1,123
  • 2
  • 14
  • 25
33
votes
2 answers

SingletonEhCacheRegionFactory vs EhCacheRegionFactory

This link (from the creator of Ehcache) says you should use SingletonEhCacheRegionFactory when you only have one Hibernate SessionFactory, and EhCacheRegionFactory when you have multiple. But wouldn't EhCacheRegionFactory be a single instance anyway…
Brad Cupit
  • 6,200
  • 8
  • 51
  • 58
31
votes
5 answers

Using Spring cache annotation in multiple modules

I have a util module that produces a jar to be used in other applications. I'd like this module to use caching and would prefer to use Spring's annotation-driven caching. So Util-Module would have something like…
Snekse
  • 14,360
  • 10
  • 53
  • 73
31
votes
2 answers

How to disable the Ehcache update checker?

12:18:55,541 INFO [UpdateChecker] New update(s) found: 2.0.0 [http://ehcache.org/news.html] How do I suppress ehcache checking for new update(s), this is happening while loading my j2ee application and when ehcache is getting initialized.
Joe
  • 12,573
  • 26
  • 77
  • 140
29
votes
4 answers

Hibernate cache strategy

How do I decide which CacheConcurrencyStrategy to use? NonstrictReadWriteCache, ReadOnlyCache, ReadWriteCache, TransactionalCache. I read https://www.hibernate.org/hib_docs/v3/api/org/hibernate/cache/CacheConcurrencyStrategy.html, but doesn't…
cometta
  • 32,613
  • 72
  • 206
  • 316
1
2 3
99 100