Questions tagged [jcache]

JCACHE :JSR 107- Java Temporary Caching API. Specifies API and semantics for temporary, in-memory caching of Java objects, including object creation, shared access, spooling, invalidation, and consistency across JVM's. source: https://jcp.org/en/jsr/detail?id=107

Introduction

Cache is the API being defined in JSR107. It defines a standard Java Caching API for use by developers and a standard SPI ("Service Provider Interface") for use by implementers.

Maven Dependency:

<dependency>
    <groupId>javax.cache</groupId>
    <artifactId>cache-api</artifactId>
    <version>1.0.0</version>
</dependency>

Gradle dependency:

compile 'javax.cache:cache-api:1.0.0'

The specification is available online.

184 questions
0
votes
0 answers

The best way to use Cache API in Java for newbies

I have a small application in java that gets the data from external api. To make it faster. I want to use a caching API. But whether I use JCache or Ehcache I get the same error hzinstance_jcache_shared [dev] [4.2.2] Exception during initial…
MacKamski
  • 3
  • 2
0
votes
1 answer

How to work with Hazelcast in client-server topology with JCache?

I'm using Jakarta EE 8, JCache API 1.1.1 and Hazelcast client 4.2.1 and server (tried 4.2.1 and 5.0-beta). I created provider for cache manager: @ApplicationScoped public class MyCacheManager { private CacheManager manager; @Produces …
0
votes
1 answer

Jhipster EHCache3.x how could definded the disk persistence where in cachaManager

I was use the jhipster-generator 6.10.5 to generate a proj, use the ehcache as the cacheProvider. package com.xxx.generated.config; import java.time.Duration; import org.ehcache.config.builders.*; import org.ehcache.config.units.MemoryUnit; import…
Damien.J
  • 25
  • 4
0
votes
2 answers

How to listen ehcache clear event?

I want to be notified when a whole cache region is cleared. How can I register a listener for this type of event? Cache event listeners are used only for entry scope operation, but I want to listen for whole cache clear event.
cdalxndr
  • 1,435
  • 1
  • 15
  • 20
0
votes
1 answer

what's the difference between haazelcast Imap and ICache?

I want to know when it's better to use Imap and when to use Icache. There is a big ambuity to choose between both of them. I know this question may be a duplicate of Difference in IMap and ICache in Hazelcast but is it possible to get more details…
BenMansourNizar
  • 1,558
  • 4
  • 21
  • 42
0
votes
1 answer

Set Ehcache's persistence directory programmatically on Spring Boot

I'm setting my caches programmatically on Spring Boot and I need to set the persistence directory. According to Ehcache's documentation, this must be done globally at the CachingProvider level: CachingProvider cachingProvider =…
Fábio
  • 3,291
  • 5
  • 36
  • 49
0
votes
3 answers

XML cacheManger bean : Multiple CachingProviders error

hello so I used to use one single cache provider to manage my caches but now I have to use more than one and I'm getting some problem in init my bean in fact I get this error : is there any possibility to define a specific provider for my XML bean? …
aabc
  • 9
  • 5
0
votes
1 answer

EhCacheManager bean return alway Null

Hello so I am trying to create EhCacheManager and configure the bean so I can inject it in my code the problem is I always have a null pointer whenever I wanna use the bean to get cache ( pre-configured in ehcache.xml) My EhCacheManager bean
aabc
  • 9
  • 5
0
votes
1 answer

jCache providers features

So i'm going to use jCache implementation for my J2EE application java 8 and i want to know what is the difference between all the providers and all its features. Hazecast ehcache infinispan can anyone help me to choose one of them ( in terms of…
aabc
  • 9
  • 5
0
votes
2 answers

Two CacheManagers overriding each other

I have a JCacheCacheManager injected into my application by a spring boot starter. This works fine until i define an ehCacheCacheManager-Bean inside the same app, which is used in the @cacheable-annotation of a single repository method. This itself…
0
votes
1 answer

ehCache 3.0 default on-heap entries size (used with hibernate 2nd level cache)

I have hibernate 2nd level cache enabled with ehcache 3.0 implementation. I am running into an issue where the cache hits are relatively fast on around 10k entries, and very slow on around 30k entries. The slowness is not linear, which makes me…
Marwan Tushyeh
  • 1,505
  • 4
  • 24
  • 47
0
votes
2 answers

Missing MBean Type: javax.cache:type=CacheStatistics while using infinispan as 2LC in wildfly

We are using wildfly 18.0.1 as application server. As the hibernate-ehcache module is deprecated we changed to the hibernate-jcache module. Wildfly uses infinispan as jcache implementation by default. We also use java melody to monitor our…
0
votes
1 answer

Hazelcast and JCache: Custom serializers without using XML

Here is what I have: I am using Hazelcast v4.0.1 I am using JCache v1.1.1 I have several custom Serializers that I want to use. Here is my problem: My Serializers have constructor dependencies so it's not possible to declare them via the…
Lord M-Cube
  • 361
  • 3
  • 11
0
votes
1 answer

Fetching all keys from Partitioned Coherent Cache

I am doing a project and my requirement is to basically implement a Coherence Cache Dashboard. The basic idea is to fetch all the keys stored in the Coherent Cache. Is there a command or any other way to fetch all cache keys from distributed…
Codez
  • 35
  • 7
0
votes
2 answers

HazelcastSerializationException for an IMap InternalKey - how to debug or log

We are using a Class that implements Cache. The cached stored in a Hazelcast IMap, V>. There's a "remove" logic that removes by an InternalKey of . K, C and V are all Strings. public class…
Ido Gal
  • 528
  • 10
  • 26