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
2
votes
2 answers

JCache (JSR-107) vs Singleton EJB

I've been using Singleton-EJBs in this fashion (as shown by Adam Bien in his blog): @Singleton public class MyCache { ConcurrentHashMap myMap= new ConcurrentHashMap(); //...Crud methods to the map } Now…
Aksel Willgert
  • 11,367
  • 5
  • 53
  • 74
2
votes
1 answer

Does memcache / JCache work in cloud endpoints?

As my question title says, is Memcache supposed to play well with Google cloud endpoints? Locally it does, I can store a key / value pair using JCache in my application and read it from within a Google Cloud Endpoints API method. When I upload my…
Anthony Accioly
  • 21,918
  • 9
  • 70
  • 118
2
votes
0 answers

What does spooling mean in the context of JCache?

From the JCP page of JCache : The JCACHE specification standardizes in process caching of Java objects in a way that allows an efficient implementation, and removes from the programmer the burden of implementing cache expiration, mutual…
Geek
  • 26,489
  • 43
  • 149
  • 227
1
vote
1 answer

CDI exception when trying to use Infinispan JCache on OpenLiberty

I'm trying to use Infinispan and JCache API to add some caching feature tu my JEE app running on OpenLiberty. I'm trying to make it work in a POC project so, for now, I don't have any code, I'm just deploying a war with required dependencies on the…
Clément Honoré
  • 137
  • 1
  • 12
1
vote
1 answer

How to programmatically configure L2 Hibernate caches with ECache?

I'm trying to configure L2+QueryCache for Hibernate 6.1.7 in my Spring 6 app running Ehcache 3.10.x In my app, Spring-level caches with method-level @Cacheable, @CachePut, @CacheEvict, etc. work fine. I create the caches and they work as…
1
vote
1 answer

Is RocksDB and LevelDB just like Riak?

I have a question regarding some NoSQL databases. In Ehcache we have for example the JCache API, in MapDB the Map Interface and in Riak KV we have a own process with clusters. How do I exactly find out which database fits to which implementation…
user12541507
1
vote
1 answer

JCachePolicy in Camel 2

I want to implement some content-caching on my Camel 2.23.2 routes. While researching I came across Camel's JCache component which, according to the documentation, should have a JCachePolicy that would: "The JCachePolicy is an interceptor around a…
Deddiekoel
  • 1,939
  • 3
  • 17
  • 25
1
vote
1 answer

Unable to properly integrate infinispan jcache libraries with wildfly 18

I'm following the guidelines on the latest infispan 11.0 doc So I did: Installed infinispan libraries under wildfly modules directory Added dependencies on pom.xml org.infinispan
Fabrizio Stellato
  • 1,727
  • 21
  • 52
1
vote
1 answer

There is any possibility to use "cacheResolver" with hazelcast

I'm using spring cache and hazelcast, I'm just trying to save the responses to my controller: @Bean @Override public CacheManager cacheManager() { return new HazelcastCacheManager(hazelcastInstance); } //creating hazelcast cache…
Rrue
  • 31
  • 4
1
vote
2 answers

is there option provided by redis to do partial updates to cache objects

I am storing data in redis using JCA(java caching api) where key is String and value is Object which is JSON string. I have a requirement to perform partial update to cache value instead of retrieving cache value using key and then modify attribute…
1
vote
2 answers

What is a proper way to use @CacheResult annotation with cache2k

I have JavaEE application and I'm trying to use cache2k with jCache to cache results of some functions. When I call methods annotated with @CacheResult nothing happens. I'm stuck and don't know what's wrong. I added these dependencies to my pom…
paxrex
  • 41
  • 1
  • 5
1
vote
1 answer

As a library: How to provide default JCache implementation

Assume I write a library and want to cache the result some long running or fragile tasks. For that I use the JCache API in my code. So my pom.xml will contain a dependency entry like javax.cache
Christoph Schubert
  • 1,089
  • 1
  • 8
  • 16
1
vote
4 answers

Does Custom CacheStore for Ignite automatically do write-behind?

I have implemented a Custom CacheStore for Ignite to communicate with Elastic Search. Now, if ElasticSearch server is down for some time, will the data in the cache be uploaded to Elastic Search once the ES server is up?
awesomemypro
  • 531
  • 1
  • 11
  • 32
1
vote
1 answer

Why result in condition inside @Cacheable doesn't have any affect?

I have following method: @Cacheable(value = "pow_cache", unless = "#pow==3",condition = "#val<5&&#result<100") public Double pow(int val, int pow) throws InterruptedException { System.out.println(String.format("REAL invocation myService.pow(%s,…
gstackoverflow
  • 36,709
  • 117
  • 359
  • 710
1
vote
1 answer

EE8 JCache annotation CacheResult doesn't work

I'm developing a WEB APP under JBoss EAP 7.2 (EE8) using EhCache as JCache implementation (JSR 107) I have this code: @Inject CacheManager cacheManager; @CacheResult(cacheName = "roles") public List get(@CacheKey String id) { return…
Fabrizio Stellato
  • 1,727
  • 21
  • 52