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.

2379 questions
32
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
  • 14,513
  • 28
  • 82
  • 144
31
votes
3 answers

How to cache results of a Spring Data JPA query method without using query cache?

I have a Spring Boot app with Spring Data JPA (hibernate backend) repository classes. I've added a couple custom finder methods, some with specific @Query annotation to tell it how to get the data. I have already set up EhCache for the hibernate 2nd…
Kevin M
  • 2,717
  • 4
  • 26
  • 31
29
votes
5 answers

@Cacheble annotation on no parameter method

I want to have @Cacheable annotation on method with no parameter. In that case, I use @Cacheable as follows @Cacheable(value="usercache", key = "mykey") public string sayHello(){ return "test" } However, when I call this method, it doesn't get…
user3534483
  • 2,133
  • 5
  • 22
  • 19
29
votes
7 answers

How to clear all Hibernate cache (ehcache) using Spring?

I am using 2nd level cache and query cache. May I know how to programmatically clear all caches ?
cometta
  • 35,071
  • 77
  • 215
  • 324
29
votes
3 answers

Spring 3.1 @Cacheable - method still executed

I'm trying to implement Spring 3.1 caching as explained here and here, but it doesn't seem to be working: my method is run through every time even though it is marked @cacheable. What am I doing wrong? I've moved it into a junit test case with its…
Andy Miller
  • 849
  • 1
  • 9
  • 21
28
votes
9 answers

Cannot find cache named '' for CacheableOperation[] caches

My error is : Exception in thread "main" java.lang.IllegalArgumentException: Cannot find cache named 'getActionsBycasId' for CacheableOperation[public java.util.List com.codinko.database.DataBaseConnection.getActionsByCasId(int)]…
Kamlesh Kanazariya
  • 1,209
  • 2
  • 15
  • 32
28
votes
8 answers

ehcache persist to disk issues

I want to do something with ehcache in Java that I think should be extremely simple, but I've spent enough time frustrating myself with the docs... Write a value to a disk persistent cache. Shut down. Start up again and read that value. Here is my…
hross
  • 3,633
  • 2
  • 27
  • 31
28
votes
6 answers

Hibernate 2nd level cache invalidation when another process modifies the database

We have an application that uses Hibernate's 2nd level caching to avoid database hits. I was wondering if there is some easy way to invalidate the Java application's Hibernate 2nd level cache when an outside process such as a MySQL administrator…
Dougnukem
  • 14,709
  • 24
  • 89
  • 130
24
votes
3 answers

Spring 3.2 and Cache Abstraction missing EhCache implementation

I am migrating our code to Spring 3.2 version (from 3.1.3) and I've got an issue with Spring Cache Abstraction. We use EhCache implementation of CacheManager and its configuration is quite simple:
hoaz
  • 9,883
  • 4
  • 42
  • 53
23
votes
3 answers

How can I configure Ehcache 3 + spring boot + java config without xml?

I use Ehcache 2 + spring boot. Here is my config: @Bean public CacheManager cacheManager() { return new EhCacheCacheManager(ehCacheCacheManager().getObject()); } @Bean public EhCacheManagerFactoryBean ehCacheCacheManager() { …
ip696
  • 6,574
  • 12
  • 65
  • 128
23
votes
4 answers

java.lang.NoClassDefFoundError: org/hibernate/cache/EntityRegion configuring EHCache

I'm trying to add ehcache (v2.6.0) to my Hibernate 4.1.5.SP1 project, but having some configuration issues. Specifically, I'm getting a java.lang.NoClassDefFoundError: org/hibernate/cache/EntityRegion error when I try and build my Hibernate…
Dave A
  • 2,780
  • 9
  • 41
  • 60
21
votes
1 answer

Comparison of memcache, redis and ehcache as distributed caching framework

One of the decisions I need to make is what caching framework to use in my system. With so many to choose from, I am currently investigating redis, ehcache and memcached. Can anyone point to performance benchmarks of these three particular…
user308808
21
votes
4 answers

Why is EhCacheProvider deprecated?

I am configuring my hibernate project to use a 2nd-level cache provider, so that I can take advantage of query caching. I added a dependency to ehcache: net.sf.ehcache ehcache-core
RMorrisey
  • 7,637
  • 9
  • 53
  • 71
21
votes
5 answers

Ehcache shutdown causing an exception while running test suite

I'm experiencing the following problem. I have a test suit in my project and each individual test runs fine. However when I run them as a suite I some of them fails with the following exception: Caused by: java.lang.IllegalStateException: The dao…
genjosanzo
  • 3,264
  • 2
  • 16
  • 21
20
votes
10 answers

OSCache vs. EHCache

Never used a cache like this before. The problem is that I want to load 500,000 + records out of a database and do some selecting/filtering wicked fast. I'm thinking about using a cache, and preliminarily found EHCache and OSCache, any opinions?
bmw0128
  • 1,625
  • 6
  • 25
  • 31