You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Oct 3, 2022. It is now read-only.
I'm having the following exception when I read an entry that doesn't exist in the cache while I'm expecting a null. Do I have to provide a factory for the cache loader when I create the cache? currently I'm not.
CompleteConfiguration<ComposedKey, Object> config1 = newMutableConfiguration<ComposedKey, Object>()
// Configure the cache to be typesafe
.setTypes(ComposedKey.class, Object.class)
// Configure to expire entries 30 secs after creation in the cache
.setExpiryPolicyFactory(FactoryBuilder.factoryOf(newAccessedExpiryPolicy(newDuration(TimeUnit.MINUTES, 30))))
// Configure read-through of the underlying store
.setReadThrough(true)
// Configure write-through to the underlying store
.setWriteThrough(true)
// Configure the javax.cache.integration.CacheLoader// .setCacheLoaderFactory(FactoryBuilder.factoryOf(new UserCacheLoader(userDao)))// Configure the javax.cache.integration.CacheWriter// .setCacheWriterFactory(FactoryBuilder.factoryOf(new UserCacheWriter(userDao)))// Configure the javax.cache.event.CacheEntryListener with no// javax.cache.event.CacheEntryEventFilter, to include old value// and to be executed synchronously
.addCacheEntryListenerConfiguration(
newMutableCacheEntryListenerConfiguration<ComposedKey, Object>(newCacheListenerManagerJSR107Factory(), null, true,
true));
It looks like when readTrough is set to true then a cache loader should be provided.
The text was updated successfully, but these errors were encountered:
Well, I guess the NPE isn't the best option. But as the spec says (from the MutableConfiguration#setReadThrough Javadoc):
* Set if read-through caching should be used.
* <p>
* It is an invalid configuration to set this to true without specifying a
* {@link CacheLoader} {@link Factory}.
I guess the method you use to create the Cache should probably throw IllegalArgumentException (see CacheManager.createCache indeed. I'll fix that!
Leaving this as targeted to 1.0.1 until the end of the week, if the EG on @jsr107 doesn't address jsr107/jsr107tck#59 by then, I'll have no other choice than postpone to 1.0.2
I'm having the following exception when I read an entry that doesn't exist in the cache while I'm expecting a
null
. Do I have to provide a factory for the cache loader when I create the cache? currently I'm not.Here is my configuration:
It looks like when readTrough is set to
true
then a cache loader should be provided.The text was updated successfully, but these errors were encountered: