-
1. Re: FileCache store not writing entries, init, start called and no obvious attempt to create buckets or write files.
manik Jan 3, 2013 5:55 AM (in response to wooburger)Looks like you've configured the cache store to persist asynchronously (see the .async() part of your config). Try commenting this bit out and you should see the cache store persisting with every put().
Your test is pretty short, so the asynchronous persistence thread probably hasn't had time to catch up.
-
2. Re: FileCache store not writing entries, init, start called and no obvious attempt to create buckets or write files.
wooburger Jan 3, 2013 9:56 PM (in response to manik)Thanks..
Cheers Megan
-
3. Re: FileCache store not writing entries, init, start called and no obvious attempt to create buckets or write files.
ges Jan 24, 2013 10:48 PM (in response to manik)Hi,
I seem to have a similar problem with the FileCacheStore where I do not see any files persisted to the file system. I'm using the latest release - 5.2.0.CR2. Here is what I'm trying.
public static void main(String[] args) throws IOException, InterruptedException {
final DefaultCacheManager defaultCacheManager = cacheConfiguration();
defaultCacheManager.start();
final Cache<String, String> infinispanTest = defaultCacheManager.getCache("infinispanCache", true);
infinispanTest.start();
writeToCache(infinispanTest);
infinispanTest.stop();
defaultCacheManager.stop();
}
static void writeToCache(Cache<String, String> cache) {
final String keyPrefix = "key";
final String valuePrefix = "value";
for (int i = 0; i < 1000; i++) {
cache.put(keyPrefix + i, valuePrefix + i);
}
}
static DefaultCacheManager cacheConfiguration() throws IOException {
final ConfigurationBuilder configurationBuilder = new ConfigurationBuilder();
final SingletonStoreConfigurationBuilder<FileCacheStoreConfigurationBuilder> builder = configurationBuilder.loaders()
.passivation(false).shared(false).preload(true)
.addFileCacheStore()
.fsyncMode(FileCacheStoreConfigurationBuilder.FsyncMode.PER_WRITE)
.fetchPersistentState(true)
.purgerThreads(3)
.purgeSynchronously(true)
.ignoreModifications(false)
.purgeOnStartup(false)
.location("C:/Temp/test/")
.singletonStore()
.enabled(true);
final DefaultCacheManager defaultCacheManager = new DefaultCacheManager(builder.build());
return defaultCacheManager;
}
Appreciate your help in resolving this.