Questions tagged [ehcache]
Ehcache is an open source, standards compliant Java-based cache used to boost performance, offload the database and simplify scalability.
2,362
questions
0
votes
0
answers
14
views
Grails 4 and eh-cache: @CachePut don't add keys to the named caches
We have a grails 4 application (upgraded from grails 2.5.6). Now we realized that methods with the @CachePut annotation create named caches but didn't put the keys in. Which results in calling the @...
-1
votes
0
answers
23
views
How to ignore method param from caching in spring
I'm having below method and here caching TokenCache object.
@Cacheable(value = "TokenCache")
public TokenCache getToken(final String id) {
return getToken(id);
}
It was ...
0
votes
1
answer
128
views
Error when trying to run Java 17 - Spring Boot 3 project with ehcache using GraalVM native image
I'm trying to run an app with Java 17 and Spring Boot 3 using GraalVM native image support.
It's a very simple app with just a GET endpoint.
The app uses ehcache and Spring Boot cache to cache the ...
0
votes
0
answers
38
views
Hibernate 2nd level cache eviction
I'm working on a Java Spring project where we have micro services architecture, each service has an internal cache of type hibernate second level cache implemented by Ehcache region factory, to insure ...
0
votes
0
answers
41
views
Caching a function with refresh rate
I have the following scenario. Below is a minimalist version of what I am trying to do
in a simple spring boot REST API Controller and Service.
func()
{
String lv=vService.getlv("1.2.1");
...
-1
votes
1
answer
18
views
I am working with hibernate 5.3.1 but its showing On-the-fly creation of JCache Cache objects is not supported
I am adding following jars
ehcache-2.10.3
hibernate-ehcache-5.3.1.Final
slf4j-api-1.7.7
I tried this with java 11
0
votes
0
answers
27
views
How to enable specific cache names and disable other name using Caffeine cache in Spring boot application
I am using Spring Boot for my application. Using @EnableCaching annotation at application level.
Consider I have multiple cache names like below in some methods on the application
@Cacheable(value = &...
0
votes
0
answers
27
views
EhCache 3 : Too many items getting evicted from off heap store even though there is enough space off heap
I have the ehcache configuration that stores items offheap for 4G size. I do see a lot of items start to evict at around 100000 items in the cache even though cache occupied size is around 2.9G (out ...
0
votes
0
answers
32
views
NotSerializableException when trying to add hibernate cacheable to JpaRepository method using Enum with custom @Converter
I'm trying to make my JpaReposiory method cacheable using hibernate. It is throwing exception because I'm using custom Converter on enum field I guess.
My JpaRepository method where I'm using org....
0
votes
0
answers
45
views
Think CacheStoreMode.REFRESH is not working (Hibernate second level cache)
I tested the following code to study CacheStoreMode.
All of the procedures below were executed in order after one procedure was completed. The method proceeded with a web controller.
[Thread 1 : ...
0
votes
0
answers
19
views
EHCache has too many misses on the heap tier
I am using a standalone EHcache 3.10 with heap tier, and disk tier.
The heap is configured to contain 100 entries with no expirations.
Actually, the algorithm insert only 30 entries into the cache, ...
0
votes
0
answers
40
views
Ehcache 3 CacheManager NullPointerException
I have the below config
@Configuration
@EnableCaching(proxyTargetClass = true)
public class CachingConfig {
@Bean
@ConditionalOnMissingBean
public javax.cache.CacheManager cacheManager() {...
0
votes
0
answers
32
views
EHcache memory clarification
I am doing poc for my project . I am planning to to use EH-cache.
I created a below code to check the allocated/used size of different tier
java : 11
ehcache version : <ehcache3.version>3.7....
0
votes
0
answers
147
views
Cache replication in Ehcache 3.10.1 without xml configuration
The scenario is that in a Spring Boot application there is a ehcache 3.10.1 being used as second level cache and that is working fine. But problem occurs when application is running on multiple ...
0
votes
0
answers
37
views
EHCache3 Statistics
I implemeted EHCache 3.10 statistics like this after looking at this post https://github.com/ehcache/ehcache3/issues/2951
StatisticsRetrieval statsRetrievalService = new StatisticsRetrieval();
try (...
1
vote
1
answer
102
views
What is the equivalent configuration for setting size limit by heap percentage (maxBytesLocalHeap) in Ehcache 3.x?
There was a config called maxBytesLocalHeap in Ehcache 2.x where we could enter a heap percentage value. I couldn't find an equivalent in 3.x, but there's nothing about deprecation in release notes or ...
0
votes
1
answer
256
views
CacheEventListener is not working Ehcache
I'm trying to log events coming from ehcache and in logs I see the creation of cache, cache manager but not custom event listener:
2022-09-05 14:49:42.218 INFO 29767 --- [ restartedMain] org.ehcache....
1
vote
1
answer
61
views
Hibernate Session.merge() hits second level cache, but saveOrUpdate does not
I have a requirement to frequently synchronize a large collection of detached entities to the database, and am wanting to do so with Session.saveOrUpdate(). These entities are of the same type and ...
0
votes
0
answers
111
views
How to use TerraCotta clustering in EhCache 3.10 with SpringBoot?
Each version has so different information that it is difficult to use.
I am using Spring Boot EhCache version 3.10.
Without a special Java configuration file, only the expiration time is entered in ...
0
votes
1
answer
67
views
Evicting cache of a specific tenant
I have a schema-based multitenant application that uses Ehcache. Sometimes I need to evict the cache of a specific tenant/schema instead of whole application. Is there a way to achive this? Currently ...
1
vote
0
answers
160
views
Shared memory and cache Ehcache
With the risk of asking an obvious question:
If I were to set up two pods running a spring boot application with shared memory (https://access.redhat.com/documentation/en-us/...
0
votes
0
answers
107
views
Inject JCacheCacheManager from ehcache.xml and create/modify cache's expiration programmatically
I've been spinning my wheels on this for some hours now.
Working so far:
I have a spring-boot.xml file that sets the cachemanager that's within my ehcache.xml:
This works just fine. I am also able to ...
4
votes
1
answer
999
views
Spring boot @Cacheable not working as expected with @Transactional
I am not able to share the actual code because of corporate policies but below is an example of method structures.
So in the example I want to the cache on the method in Class B to be cleared when the ...
0
votes
0
answers
139
views
Why doesn't Hibernate L2 cache turn on?
I do not understand why my Hibernate L2 cache doesn't work.
I have Spring Boot application with following configuration
jpa:
database-platform: org.hibernate.dialect.PostgreSQL10Dialect
show-...
0
votes
0
answers
25
views
ehcache three tier setup using java
I am trying to setup the ehcache three tier architecture as given @ https://www.ehcache.org/documentation/3.3/getting-started.html. Please find the below configuration taken from the above website. I ...
0
votes
1
answer
86
views
How to clear/ignore ehcache's data and test via MockRestServiceServer?
We are running our component test-cases in which we load some data using cache.. Now the problem is when we try other test-cases, we want to reset the cache because it then doesn't test with the other ...
2
votes
0
answers
18
views
Does the Ehcache memory limitation apply to collection values?
I'm using Ehcache 3.9. I have a cache with key -> List<Value>. I set the memory limit on the heap to 1 MB.
Let's say I add an entry to the cache: key1 -> emptyList. Then I add many Value ...
0
votes
0
answers
58
views
Are Ehcache expired cache entries evicted periodically in version 3.x?
I'm using Ehcache 3.9 and have a 24h expiration limit on the entries of the cache. I would like the expired entries to be removed at least some time after expiration (within a few hours), as there ...
1
vote
0
answers
51
views
Throw 409 CONFLICT if data is coming from Cache - @Cachable in spring boot
I have implemented caching using spring boot and ehcache. My scenario is about implementing idempotency key for POST method and for that I have created a cache based on idempotency key with @Cacheable ...
1
vote
0
answers
1k
views
Cannot find cache named xxx for Builder with Ehcache
Just trying Caching in spring boot for the first time and getting the following error
Request processing failed; nested exception is java.lang.IllegalArgumentException: Cannot find cache named '...
0
votes
0
answers
141
views
Caused by: org.ehcache.core.spi.ServiceLocator$DependencyException: Multiple factories for non-plural service
We are getting below error while initializing ehcache:
Caused by: org.ehcache.core.spi.ServiceLocator$DependencyException: Multiple factories for non-plural service
at org.ehcache.core.spi....
0
votes
0
answers
42
views
Spring/SpringBoot and Cache Penetration
I found this article about cache penetration in Redis:
Cache Penetration, Cache Breakdown, Cache Avalanches
but the problem is general about cache (so I think EhCache too).
In the article they talk ...
0
votes
1
answer
1k
views
Ehcache - Cannot find cache name for Builder
I've looked through a lot of similar questions asked here but I'm still not able to find a solution so here's my issue:
I'm trying to setup Ehcache on springboot.
Spring 2.2.6.RELEASE
Ehcache 3.8.1
...
0
votes
0
answers
36
views
What is remoteObjectPort in enCache
I have been following the ehCache documentation regarding replication on https://www.ehcache.org/documentation/2.8/replication/rmi-replicated-caching.html
EhCache is already implemented in our project,...
0
votes
1
answer
28
views
How to set a Unexpirable cache in Sprint Boot EH Cache
I want to set up a cache which does not expire in a SPring Boot EH Cache application.
I want to reload cache based on a application parameter. How can i implement that?
I can see there is a ...
0
votes
0
answers
30
views
Orbeon Forms PE (Ehcache) replication without multicasting
We want to set up Orbeon Forms PE replication but we cannot use multicasting as proposed in the docs.
We have two nodes - 172.13.238.241 and 172.13.238.242 and the problem seems to be with the EhCache ...
0
votes
0
answers
39
views
How to sync ehcache with My SQL Database changes
I am using ehcache as my cache for springboot application. But i want to sync that ehcache with my sql database. i.e., If changes are done in data base externally then it need to be update in cache.
0
votes
0
answers
53
views
is there any better way to handle nested map from google guava in spring boot
I am trying to develop a function that handles multi-level structures with cache, for example
I am familiar with using Guava cache to handle key and value structures, but I have three table ...
0
votes
0
answers
74
views
EhCache is returning "Session is closed" after the upgrade version
We updated some libs recently such as the EhCache and Hibernate (from 4.2.1.Final to 5.4.32.Final)
After that, I notice an annoying error in the log:
2022-05-23 15:53:49.065 ERROR [my-data.data] ...
0
votes
0
answers
187
views
How to resolve java.lang.ClassNotFoundException: org.hibernate.cache.ehcache.EhCacheRegionFactory
I made a simple java project with hibernate to understand that how hibernate and in hibernate second level cache works but error has occurred java.lang.ClassNotFoundException: org.hibernate....
1
vote
0
answers
168
views
How to correctly set spring.jpa.properties.hibernate.javax.cache.uri?
What value should the parameter spring.jpa.properties.hibernate.javax.cache.uri have when using Spring Boot with Hibernate?
I've initially set it to spring.jpa.properties.hibernate.javax.cache.uri=...
0
votes
0
answers
143
views
Ehcache not fetching the cache
I am trying to setup a shared cache using ecache clustered framework.
What I am expecting is once the cache is created at server lever, next time it should be fetched directly(based on cache name).
...
4
votes
1
answer
599
views
Ehcache 2 maven dependency
In my pom i have ehcache 2 dependency
<dependency>
<groupId>net.sf.ehcache</groupId>
<artifactId>ehcache</artifactId>
<...
0
votes
0
answers
375
views
EhCache pre-allocates all off-heap memory
When creating an EhCache cache with off-heap memory, the size of off-heap is immediately allocated, while it may never be used. This creates problems when creating multiple caches, or even having ...
0
votes
0
answers
350
views
EhCache with HashMap as values returns null on get when using off-heap cache
The following EhCache code, with maps as values and off-heap memory, fails a simple put/get unit test (see below).
import org.ehcache.Cache;
import org.ehcache.CacheManager;
import org.ehcache.config....
0
votes
0
answers
109
views
Does Spring Boot "@Transactional" annotation apply to EhCache-backed caches?
Spring Boot, JPA (Hibernate) and Java/JSR-107 Caching (EhCache) here.
I have a service method where I need to update both a table and a cache at the same time:
@Service
public class WorkService {
...
1
vote
0
answers
30
views
Use several ehcache XML files in same project
I have a project done with Spring framework that uses ehcache. This project has a resource file named xxxx_ehcache.xml . Now this project has a dependency with a library that is in turn using ehcache ...
0
votes
1
answer
277
views
How to use and config caching in Spring MVC
I want to cache the following getMessagesList method. I want to call one time When user log into the system. Therefor I think caching is the best solution for that. And I need to remove when user log ...
1
vote
1
answer
399
views
Ehcache 3 spring boot not working in integration test
I need your help please. I integrated Ehcache 3 with springboot 2. everything works perfectly in production. integration tests also work if i execute them manualy ( I'm using Intellij IDE ).
but when ...
0
votes
0
answers
253
views
0 nanoseconds spent performing 0 L2C hits;
As discussed in my previous post Too many mysql db call issue with spring boot rest service
I have followed https://www.baeldung.com/spring-cache-tutorial this tutorial and enabled hibernate second ...