Changelog History
Page 3
-
v1.2.2.Final Changes
June 07, 2019🐎 cache2k is a high performance and light weight in-process caching library. Compared to other libraries
(EHCache, Guava and Caffeine) it achieves the highest throughput for cache hits while still providing
one of the best eviction efficiency. Advanced features of cache2k, like refresh ahead and resilience
can solve typical application problems with ease.🛠 This is a bugfix / service release.
🌲 This change log lists changes since the last version 1.2.1.Final.
🔄 Changes
- 🛠 Fix integer overflow with cache sizes beyong 10 million entries,GH#111
- ➕ Add
automatic-module-name
manifest entry for thecache2k-api
jar as a first step for Jigsaw/Modules support, GH#112
Using this cache2k version
The binaries are available on maven central.
For Java SE/EE and Android environments
For Maven users:
<dependency> <groupId>org.cache2k</groupId> <artifactId>cache2k-base-pom</artifactId> <version>1.2.2.Final</version> <type>pom</type> </dependency>
Recommended for Gradle users:
def cache2kVersion = '1.2.2.Final' dependencies { implementation "org.cache2k:cache2k-api:${cache2kVersion}" runtimeOnly "org.cache2k:cache2k-core:${cache2kVersion}" }
Note to Android users: The included jar files contain code that might only be needed in server environments (e.g. JMX support).
✅ It is possible to strip unnecessary code. Example ProGuard rules can be found at Andriod - cache2k User GuideUsing the JCache / JSR107 provider
Maven users include the cache2k JCache provider this way:
<dependency> <groupId>org.cache2k</groupId> <artifactId>cache2k-jcache</artifactId> <version>1.2.2.Final</version> <scope>runtime</scope> </dependency>
For Gradle users:
dependencies { runtimeOnly "org.cache2k:cache2k-jcache:1.2.2.Final" }
🔧 Implementation details, tuning tips and hints on configuration can be found at: JCache - cache2k User Guide
-
v1.2.1.Final Changes
March 08, 2019🐎 cache2k is a high performance and light weight in-process caching library. Compared to other libraries
(EHCache, Guava and Caffeine) it achieves the highest throughput for cache hits while still providing
one of the best eviction efficiency. Advanced features of cache2k, like refresh ahead and resilience
can solve typical application problems with ease.🛠 This is a bugfix / service release.
🌲 This change log lists changes since the last version 1.2.0.Final.
🛠 Fixes
- ✂ Remove bom dependency in
cache2k-spring
, fixing GH#94 - 🔧 JCache: Enable use of loader and read through, if loader is configured via XML, fixing GH#103
Using this cache2k version
The binaries are available on maven central.
For Java SE/EE and Android environments
For Maven users:
<dependency> <groupId>org.cache2k</groupId> <artifactId>cache2k-base-pom</artifactId> <version>1.2.1.Final</version> <type>pom</type> </dependency>
Recommended for Gradle users:
def cache2kVersion = '1.2.1.Final' dependencies { implementation "org.cache2k:cache2k-api:${cache2kVersion}" runtimeOnly "org.cache2k:cache2k-core:${cache2kVersion}" }
Note to Android users: The included jar files contain code that might only be needed in server environments (e.g. JMX support).
✅ It is possible to strip unnecessary code. Example ProGuard rules can be found at Andriod - cache2k User GuideUsing the JCache / JSR107 provider
Maven users include the cache2k JCache provider this way:
<dependency> <groupId>org.cache2k</groupId> <artifactId>cache2k-jcache</artifactId> <version>1.2.1.Final</version> <scope>runtime</scope> </dependency>
For Gradle users:
dependencies { runtimeOnly "org.cache2k:cache2k-jcache:1.2.1.Final" }
🔧 Implementation details, tuning tips and hints on configuration can be found at: JCache - cache2k User Guide
- ✂ Remove bom dependency in
-
v1.2.0.Final Changes
August 23, 2018🐎 cache2k is a high performance and light weight in-process caching library. Compared to other libraries (EHCache, Guava and Caffeine) it achieves the highest throughput for cache hits while still providing one of the best eviction efficiency. Advanced features of cache2k, like refresh ahead and resilience can solve typical application problems with ease.
🐎 Highlights of the new version: Spring Framework integration, optimized footprint on Android with provided ProGuard rules, performance and initialization improvements in JCache to optimize the use as L2 cache in Hibernate or Datanucleus.
🌲 This change log lists the complete changes since the last stable version 1.0.2.Final.
🆕 New and Noteworthy
- 👌 Support for Spring caching abstraction. See the user guide on Spring Framework Integration
- cache2k is now delivered in two jar files,
cache2k-api
contains the API andcache2k-core
the implementation. Both jar files need to be present at runtime. GH#80 - 🐎 Optimized cache version for integer keys with better memory footprint and access performance since no autoboxing is needed.
- 🔧 XML configuration becomes XSD schema, also some structural changes and improvements
- JCache speedup: Don't copy values or allow listener attachment if this is not needed.
This improves speed when used as L2 cache in Hibernate or Datenucleus.
API Changes
IntCache
andLongCache
for int and long keys, plusIntKeyValueSource
andLongKeyValueSource
Cache2kBuilder.getManager()
returns the cache manager- ➕ Add
CacheManager.getConfiguredCacheNames
to get a list of caches that are specified in the XML configuration
API Changes and Potential breakages
Below changes affect potentially existing applications. The version 1.2 is not strictly binary compatible.
Cache.computeIfAbsent
propagatesRuntimeException
without wrapping- Renaming of method on
MutableCacheEntry
:setExpiry
tosetExpiryTime
- 👀 JMX support is not enabled by default any more. It can be enabled per cache or globally, see the Statistics - cache2k Use Guide
- 👌 improve generic type parameters in configuration classes, affected:
Cache2kConfiguration.setKeyType
,Cache2kConfiguration.setValueType
,CacheType
- 📚
CacheEntry.getLastModifiedTime
is not supported any more. Permanently throws exception, see: CacheEntry.getLastModifications - cache2k API documentation
Alternative method is via:MutableCacheEntry.getRefreshedTime()
- 🗄
Cache2kBuilder.disableLastModificationTime
: deprecated, has no effect - 🔧
ConfigurationSectionContainer
: Implements collection interface, method add returns a boolean. - 👀 XML configuration: scopes are lower case, structual changes, see below and the examples
🛠 Fixes
Cache.replaceIfEquals
: Fix potential NPE, if listener or writer is used- 🚚
Cache.removeIfEquals
statistics: count miss and hit consistently - NPE in
Cache.putAll
when used withConcurrentHashMap
, GH#90
👌 Improvements
- 📇 Rename jar
cache2k-all
tocache2k-osgi-all
. This contains a bundle of thecache2k-api
and
cache2k-core
jar file and is kept for OSGi environments only. This special variant is likely to
👀 be dropped in the future, see: GH#83.
This combined jar should not be used any more to avoid potential duplication in the class path. - 🔧
cache2k-core
: Code for XML configuration or JMX support is included but can be removed (e.g. via ProGuard rules)
if not needed - consolidate the output of the cache coordinates in the
toString
outputs - CacheManager: add
toString()
output - 🔄 change timer implementation, faster operation when expiry is used
- ✅ Introduce simulated clock and improve test coverage for timing related features
- 👌 Improve timer robustness by changing thread priorities
- 🚚 Code quality: Unused code removed
- 📇 Rename thread prefix for async listener execution from
cache2k-async
tocache2k-listener
- 🏗
Cache2kBuilder.build
throwsIllegalStateException
if cache with identical name already is created - 🔧
Cache2kConfiguration.isExternalConfigurationPresent
is nowtrue
if there is an XML default configuration - 🔧 Default configuration and class loaders: hold separate default configuration per class loader
- 👍
Cache2kConfiguration
: add setters for collections (listeners and sections) to better integrate with other
🔧 generic configuration code like Springs' bean XML configuration. - 🔄 Change
ConfigurationException
source location message to standard, like(cache2k.xml:123)
direct highlighting and click in IntelliJ works - 🔧 XML configuration: Default value in variables: E.g.
${env.CACHE_SIZE:-2000}
, uses the environment variable or 2000 if not present - 🔧 XML configuration: No element
<users>
in the<properties>
- 🔧 XML configuration:
<parameters>
element for bean values to the customizer suppliers - 🔧 XML configuration: The scope for the system properties is renamed from
prop
tosys
. - 🔧 XML configuration: A variable without scope (e.g.
${xy}
) refers to the properties section in the configuration file - 🔧 XML configuration: Variable (e.g.
env
andsys
) scopes in the configuration are changed to lower case - 🔧 JCache speedup: Do not support online listener attachment by default if in cache2k configuration mode.
👀 See JCache Optimizations and Semantics - cache2k Use Guide - 🔧 JCache: If a cache is present in the XML configuration
CacheManager.getCache
creates the cache based on the present configuration.
Some clients (e.g. Spring) useCacheManager.getCache
to request an exiting/known cache. - JCache: ignore
isWriteThrough
flag and just use the writer when present. This avoids an NPE if a cache client enables
🔧 write through but does not provide a writer, which is an illegal configuration (found in Datanucleus). - 🔧 JCache and XML configuration: allow
expireAfterWrite
to be configured via XML - 🔧 JCache configuration: switch to cache2k semantics whenever a cache2k configuration file is present
0️⃣ (before either a default or cache section needed to be present) - 🖨 JCache: print useful
toString()
output for a JCache cache, delegates to the underlying cache2k cache - 👻 JCache: clarify manager URIs and improve exception text GH#91
Using this cache2k version
The binaries are available on maven central.
For Java SE/EE and Android environments
For Maven users:
<dependency> <groupId>org.cache2k</groupId> <artifactId>cache2k-base-pom</artifactId> <version>1.2.0.Final</version> <type>pom</type> </dependency>
Recommended for Gradle users:
def cache2kVersion = '1.2.0.Final' dependencies { implementation "org.cache2k:cache2k-api:${cache2kVersion}" runtimeOnly "org.cache2k:cache2k-core:${cache2kVersion}" }
Note to Android users: The included jar files contain code that might only be needed in server environments (e.g. JMX support).
✅ It is possible to strip unnecessary code. Example ProGuard rules can be found at Andriod - cache2k User GuideUsing the JCache / JSR107 provider
Maven users include the cache2k JCache provider this way:
<dependency> <groupId>org.cache2k</groupId> <artifactId>cache2k-jcache</artifactId> <version>1.2.0.Final</version> <scope>runtime</scope> </dependency>
For Gradle users:
dependencies { runtimeOnly "org.cache2k:cache2k-jcache:1.2.0.Final" }
🔧 Implementation details, tuning tips and hints on configuration can be found at: JCache - cache2k User Guide
-
v1.1.4.Beta Changes
August 14, 2018🚀 This is the first release candidate for version 1.2. Please give feedback to help stabilize and improve the next version.
🛠 Fixes and Improvements
- 📇 Rename
MutableCacheEntry.getRefreshTime
toMutableCacheEntry.getRefreshedTime
- 🔄 Change
ConfigurationException
source location message to standard, like(cache2k.xml:123)
direct highlighting and click in IntelliJ works - 🔧 Various modifications in the configuraiton:
- 0️⃣ Default value in variables: E.g.
${env.CACHE_SIZE:-2000}
, uses the environment variable or 2000 if not present - No element
<users>
in the<properties>
<parameters>
element for bean values to the customizer suppliers- The scope for the system properties is renamed from
prop
tosys
. - 🔧 A variable without scope (e.g.
${xy}
) refers to the properties section in the configuration file - 🔧 Variable (e.g.
env
andsys
) scopes in the configuration are changed to lower case
Using this cache2k version
The binaries are available on maven central.
For Java SE/EE and Android environments
For Maven users:
<dependency> <groupId>org.cache2k</groupId> <artifactId>cache2k-base-pom</artifactId> <version>1.1.4.Beta</version> <type>pom</type> </dependency>
Recommended for Gradle users:
def cache2kVersion = '1.1.4.Beta' dependencies { implementation "org.cache2k:cache2k-api:${cache2kVersion}" runtimeOnly "org.cache2k:cache2k-core:${cache2kVersion}" }
Note to Android users: The included jar files contain code that might only be needed in server environments (e.g. JMX support).
✅ It is possible to strip unnecessary code. Example ProGuard rules can be found at Andriod - cache2k User GuideUsing the JCache / JSR107 provider
Maven users include the cache2k JCache provider this way:
<dependency> <groupId>org.cache2k</groupId> <artifactId>cache2k-jcache</artifactId> <version>1.1.4.Beta</version> <scope>runtime</scope> </dependency>
For Gradle users:
dependencies { runtimeOnly "org.cache2k:cache2k-jcache:1.1.4.Beta" }
🔧 Implementation details, tuning tips and hints on configuration can be found at: JCache - cache2k User Guide
- 📇 Rename
-
v1.1.3.Alpha Changes
August 02, 2018This version is a development preview and not recommended for production use. Please give feedback to help stabilize and improve the next version.
🆕 New and Noteworthy
- 📇 rename
cache2k-impl
tocache2k-core
. That should be more intuitive for containing the actual "core" cache implementation in case there are morecache2k-xy
jars in the classpath. - 🔧 XSD schema for the XML configuration
Possible breakages
- Renaming of method on
MutableCacheEntry
:setExpiry
tosetExpiryTime
- 👀 JMX support is not enabled by default any more. It can be enabled per cache or globally, see the Statistics - cache2k Use Guide
- 👌 improve generic type parameters in methods related to cache type configuration, affected methods:
Cache2kConfiguration.setKeyType
,Cache2kConfiguration.setValueType
,CacheType
- 📚
CacheEntry.getLastModifiedTime
is not supported any more. Permanently throws exception, see: CacheEntry.getLastModifications - cache2k API documentation - 🗄
Cache2kBuilder.disableLastModificationTime
: deprecated, has no effect any more.
Logic is reversed. The feature needs to be switched on when needed viarecordRefreshTime
. - 🔧
ConfigurationSectionContainer
: Implements collection interface, method add returns booleans.
🛠 Fixes and Improvements
- 🔧 JCache speedup: Do not support online listener attachment by default if in cache2k configuration mode.
👀 See JCache Optimizations and Semantics - cache2k Use Guide - 🚚
Cache.removeIfEquals
statistics: count miss and hit consistently - 👻 Exception propagation of
CacheEntry.getValue
covered by exception propagator again - 🔧 JCache configuration: switch to cache2k semantics whenever a cache2k configuration file is present
0️⃣ (before either a default or cache section needed to be present) - 🖨 JCache, toString(): print useful toString() output for a JCache cache, delegates to the underlying cache2k cache
- ⚡️
Cache2kBuilder.recordRefreshTime
: Record time of last update or modification of an entry and make it
available via `MutableCacheEntry.getRefreshTime - consolidate the output of the cache coordinates in the
toString
outputs - 👍
Cache2kConfiguration
: add setters for collections (listeners and sections) to better integrate with other
🔧 generic configuration code like Springs' bean XML configuration.
Using this cache2k version
The binaries are available on maven central.
For Java SE/EE and Android environments
For Maven users:
<dependency> <groupId>org.cache2k</groupId> <artifactId>cache2k-base-pom</artifactId> <version>1.1.3.Alpha</version> <type>pom</type> </dependency>
Recommended for Gradle users:
def cache2kVersion = '1.1.3.Alpha' dependencies { implementation "org.cache2k:cache2k-api:${cache2kVersion}" runtimeOnly "org.cache2k:cache2k-core:${cache2kVersion}" }
Note to Android users: The included jar files contain code that might only be needed in server environments (e.g. JMX support).
✅ It is possible to strip unnecessary code. Example ProGuard rules can be found at Andriod - cache2k User GuideUsing the JCache / JSR107 provider
Maven users include the cache2k JCache provider this way:
<dependency> <groupId>org.cache2k</groupId> <artifactId>cache2k-jcache</artifactId> <version>1.1.3.Alpha</version> <scope>runtime</scope> </dependency>
For Gradle users:
dependencies { runtimeOnly "org.cache2k:cache2k-jcache:1.1.3.Alpha" }
🔧 Implementation details, tuning tips and hints on configuration can be found at: JCache - cache2k User Guide
- 📇 rename
-
v1.1.2.Alpha Changes
July 17, 2018This version is a development preview and not recommended for production use. Please give feedback to help stabilize and improve the next version.
🆕 New and Noteworthy
- 🐎 Optimized cache version for integer keys with better memory footprint and access performance since no autoboxing is needed.
- 👌 Support for Spring caching abstraction. See the user guide on Spring Framework Integration
API Changes
IntCache
andLongCache
for int and long keys, plusIntKeyValueSource
andLongKeyValueSource
Cache2kBuilder.getManager()
returns the cache managerCache.computeIfAbsent
propagatesRuntimeException
without wrapping
🛠 Fixes and Improvements
- 🚚 Code quality: Unused code removed, various tests with simulated clock for expiry and refresh added
- 👻
CacheEntry.getLastModificationTime()
throws exception if this functionality is disabled - skip time recording correctly when
disableLastModificationTime
is set - ✂ Remove
SimpleCacheEntry
introduced before in1.1.1.Aplha
since this bloats the API - 📇 Rename thread prefrix for async listener execution from
cache2k-async
tocache2k-listener
- ➕ Add
CacheManager.getConfiguredCacheNames
to get a list of caches that are specified in the XML configuration - 🔧 JCache: If a cache is present in the XML configuration
CacheManager.getCache
creates the cache based on the present configuration.
Some clients (e.g. Spring) useCacheManager.getCache
to request an exiting/known cache. - JCache: ignore
isWriteThrough
flag and just use the writer when present. This avoids an NPE if a cache client enables
write through but does not provide a writer (as found in datanucleus).
Using this cache2k version
For Java SE/EE and Android environments
<dependency> <groupId>org.cache2k</groupId> <artifactId>cache2k-api</artifactId> <version>1.1.2.Alpha</version> </dependency> <dependency> <groupId>org.cache2k</groupId> <artifactId>cache2k-impl</artifactId> <version>1.1.2.Alpha</version> <scope>runtime</scope> </dependency>
Note to Android users: The
cache2k-impl
contains code that might only be needed in server environments (e.g. JMX support).
✅ If not needed, it is possible to strip unnecessary code. Example ProGuard rules can be found at cache2k user guide - Android secionUsing the JCache / JSR107 provider
<dependency> <groupId>org.cache2k</groupId> <artifactId>cache2k-jcache</artifactId> <version>1.1.2.Alpha</version> </dependency> <dependency> <groupId>javax.cache</groupId> <artifactId>cache-api</artifactId> <version>1.1.0</version> </dependency>
-
v1.1.1.Alpha Changes
July 02, 2018This version is a development preview and not recommended for production use. Please give feedback to help stabilize and improve the next version.
🆕 New and Noteworthy
- cache2k is now delivered in two jar files,
cache2k-api
contains the API andcache2k-impl
the
implementation. Both jar files need to be present at runtime. GH#80 - Tiny API changes to improve integration with other frameworks
API Changes
- Cache:
Cache.getSimpleEntry
,Cache.peekSimpleEntry
- 🆕 New exception:
UnknownCacheException
- 🏗
Cache2kBuilder.build
throwsIllegalStateException
if cache with identical name already is created
🛠 Fixes and Improvements
- 🔧
CacheEntry.getValue()
: does not make use of the configurable exception propagator any more to simplify internal code - faster access to a cache entry in case only the value is needed via:
Cache.getSimpleEntry
,Cache.peekSimpleEntry
- async expiry listener: fix potential data inconsistency on the entry value and last modification time
- 📇 Rename jar
cache2k-all
tocache2k-osgi-all
. This contains a bundle of thecache2k-api
and
cache2k-impl
jar file and is kept for OSGi environments only. This special variant is likely to
👀 be dropped in the future, see: GH#83.
This combined jar should not be used any more to avoid potential duplication in the class path. - 🔄 change timer implementation, faster operation when expiry is used
- 👌 Improve timer robustness by changing thread priorities
- 👌 Improve test coverage for timing related features
- 🔧
Cache2kConfiguration.isExternalConfigurationPresent
is nowtrue
if there is an XML default configuration - 🔧 JCache and XML configuration: allow
expireAfterWrite
to be configured via XML - 🔧 Default configuraton and class loaders: hold separate default configuration per class loader
- CacheManager: add
toString()
output - 🔧
cache2k-impl
: Code for XML configuration or JMX support is optional and can be removed, e.g. via ProGuard rules
Using this cache2k version
For Java SE/EE and Android environments
<dependency> <groupId>org.cache2k</groupId> <artifactId>cache2k-api</artifactId> <version>1.1.1.Alpha</version> </dependency> <dependency> <groupId>org.cache2k</groupId> <artifactId>cache2k-impl</artifactId> <version>1.1.1.Alpha</version> <scope>runtime</scope> </dependency>
Note to Android users: The
cache2k-impl
contains code that might only be needed in server environments (e.g. JMX support). If not needed, it is possible to strip unnecessary code. Example ProGuard rules can be found at cache2k user guide - Android secionUsing the JCache / JSR107 provider
<dependency> <groupId>org.cache2k</groupId> <artifactId>cache2k-jcache</artifactId> <version>1.1.1.Alpha</version> </dependency> <dependency> <groupId>javax.cache</groupId> <artifactId>cache-api</artifactId> <version>1.1.0</version> </dependency>
- cache2k is now delivered in two jar files,