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
1
vote
1 answer

Spring JCache conditional caching

Does spring's JCache annotation @CacheResult allow conditional caching like Spring's own annotation? e.g. @Cacheable(cacheNames="book", condition="#name.length < 32", unless="#result.hardback") I could not find anything in the documentation nor…
abhijitab
  • 101
  • 1
  • 3
1
vote
1 answer

Error in JCache implementation with Hazelcast CompleteConfiguration-class not found

I'm trying to setup a simple example app for testing a jcache implementation of hazelcast. Example code: CachingProvider cachingProvider = Caching.getCachingProvider(); CacheManager cacheManager = cachingProvider.getCacheManager(); Cache
Samuel_vdc
  • 117
  • 1
  • 7
1
vote
2 answers

What are the Maven coordinates for the JCache API jar?

I have an executable JAR (not a web app being deployed to a standard container like Tomcat, etc.) that needs to connect to a DB and cache a lot of stuff. If at all possible, I'd like to use the JCache API and inject (via Guice) the Hazelcast…
smeeb
  • 27,777
  • 57
  • 250
  • 447
1
vote
1 answer

Hazelcast JCache CacheEntryListener triggered too often

it seems to me that I have a problem with the callback mechanism of the JCache EntryListener. I am trying to set up several jcache members (hazelcast implementation), each running on their on as single java application on my local machine (for now…
sebjun87
  • 61
  • 1
  • 3
1
vote
2 answers

JCache with Oracle Coherence

Oracle Coherence states that it is "JCache-compliant". How can I take my code written against JSR-107, specifically the ehcache-jcache jar, and run it against Oracle Coherence?
AWhitford
  • 3,708
  • 3
  • 28
  • 38
1
vote
0 answers

Pre-populating a cache with Spring's JSR-107 annotations

I have a table with often-read, rarely-changed records (about 50,000) that I need to cache. I'd like to pre-populate the cache at server startup time with a single query loading all records. I'm not sure what's the best way to do it when using…
wishihadabettername
  • 14,231
  • 21
  • 68
  • 85
1
vote
1 answer

Hazelcast - Jacache cacheManager.getCache returning null - Throwning ClassCastException

I am using Jache and Hazelcast as the implenentation in my web application, when I am deploying my application on tomcat I have a context listener which calls CacheManager and loads some data, Now when it tries to get the Cache from CacheManager…
Shantanoo K
  • 765
  • 5
  • 15
  • 43
1
vote
0 answers

Configuration in ehcache.xml is not used on created JCache instances

I'm trying to use EHCache implementation of JCache (JSR 107), I provide the following configuration file under src\main\resources\ehcache.xml:
bachr
  • 5,780
  • 12
  • 57
  • 92
1
vote
2 answers

JSR 107 - Caching (JCache) vs CPU caching

I read about JSR 107 Caching (JCache). I'm confused: From what I know, every CPU manage his caching memory (without any help from OS). So, why do we need Java Caching handler ? (if the CPU manage his own cache) What I miss here ? Thanks
user3668129
  • 4,318
  • 6
  • 45
  • 87
1
vote
1 answer

JCache ACL Cache for Spring Security

I'm using Spring Security ACL and it needs to have cache defined. So far I was using this: @Bean(name = { "defaultAclCache", "aclCache" }) protected AclCache defaultAclCache() { return new SpringCacheBasedAclCache(defaultAclJCacheFactory(),…
Petar Tahchiev
  • 4,336
  • 4
  • 35
  • 48
1
vote
2 answers

Google AppEngine (Java) Memcache not storing data

I have this code //net.sf.jsr107cache.Cache, CacheException, CacheFactory, CacheManager all imported private static Cache getCache() { Cache cache = null; try { CacheFactory cacheFactory =…
Sayo Oladeji
  • 741
  • 4
  • 15
  • 28
1
vote
1 answer

GAE, JDO, Jcache: can't put a list of entities to the cache

I have a query which returns a list of entities. When I try to put this list to the cache, I get the familiar java.lang.IllegalArgumentException. However... I can put every item inside the list to the cache with no problems. Even when I create a new…
tobik
  • 7,098
  • 7
  • 41
  • 53
1
vote
1 answer

GAE, JDO: working with entities loaded from cache

I use simple layer for loading and storing entities by key or id and I just added caching to this layer. When entity with given key is in the cache, return it rather then fetch from the datastore. And when the entity is updated and saved to…
tobik
  • 7,098
  • 7
  • 41
  • 53
1
vote
1 answer

Ehcache as JCache Implementation configured in Spring

I am trying to use the following jcache-ehcache library to as a wrapper so that I can use Ecache as my JCache implementation. These are my maven dependancies: net.sf.ehcache
totalcruise
  • 1,343
  • 2
  • 13
  • 25
0
votes
1 answer

OpenLiberty caching feature

I would like to add some caching features to my JEE application running on OpenLiberty. I would rely on JCache API and Infinispan. I understand that some OpenLiberty features could use some caching capabilities relying on this stack (session caching…
Clément Honoré
  • 137
  • 1
  • 12