-
1. Re: Persistent Caches - when do the contents get written.
amin59 Jan 27, 2010 1:44 PM (in response to meetoblivion)Since your store is configured as async with threadPool size 5, it means that there are five threads apart from main thread waiting to sync modification to store.
If your cache store is fast enough this means almost sync with rate of change, but if not, then changes get aggregate and the very last value of modified keys is synced whenever one of threads becomes available. https://jira.jboss.org/jira/browse/ISPN-116
Have a look at this too: http://community.jboss.org/wiki/Write-ThroughAndWrite-BehindCaching
-
2. Re: Persistent Caches - when do the contents get written.
amin59 Jan 27, 2010 1:49 PM (in response to amin59)btw there is this issue in the current release which may affect store process but is in progress https://jira.jboss.org/jira/browse/ISPN-340 -
3. Re: Persistent Caches - when do the contents get written.
meetoblivion Jan 27, 2010 10:36 PM (in response to amin59)so as far as I'm concerned, writing synchronously is fine. the way the app will work, an offline process (ejb timer) will populate the cache, probably only once or twice in the next 6 weeks or so. that part's fine.
The only part i had to change was the loaders config.
<loaders passivation="true" shared="false" preload="true">
-
4. Re: Persistent Caches - when do the contents get written.
meetoblivion Jan 31, 2010 9:13 PM (in response to meetoblivion)So i'm still running into something weird.
Now, I'm running on my linux laptop. It was working fine, but now I've noticed that after restarting the app server (glassfish) contents get deleted but not readded. after modifying the values again, I don't see the new writes.
Here's my configuration:
{code:xml} <namedCache name="persistentCache">
<loaders passivation="true" shared="false" preload="true">
<loader
class="org.infinispan.loaders.file.FileCacheStore"
fetchPersistentState="true" ignoreModifications="false"
purgeOnStartup="false">
<properties>
<property name="location" value="/dumps/cache"/>
</properties>
</loader>
</loaders>
</namedCache>{code}I use a JSF front end and CDI to work with the actions. Here's some code:
{code}@SessionScoped @Named("addCacheAction")
public class AddCacheAction implements java.io.Serializable{
private InputForm inputForm = new InputForm();
@EJB Initializer init;
public InputForm getInputForm() {
return inputForm;
}
public void setInputForm(InputForm inputForm) {
this.inputForm = inputForm;
}
public String addToCache() {
Cache<String,String> cache = init.getCache("persistentCache");
cache.put(inputForm.getKey(), inputForm.getValue());
inputForm = new InputForm();
return "/main.xhtml";
}
@Produces @Named("cacheList") @RequestScoped
public List<String> produceCacheList() {
Cache<String,String> cache = init.getCache("persistentCache");
List<String> values = new ArrayList<String>();
Set<Map.Entry<String,String>> entries = cache.entrySet();
for(Map.Entry<String,String> entry : entries) {
values.add(String.format("%s : %s",entry.getKey(),entry.getValue()));
}
return values;
}
}{code} -
5. Re: Persistent Caches - when do the contents get written.
meetoblivion Feb 1, 2010 9:51 AM (in response to meetoblivion)so it seems like the issue is related to having both passivation and preload set to true. What is passivation supposed to do? I figured it had to do with writing the cache. -
6. Re: Persistent Caches - when do the contents get written.
manik Feb 2, 2010 7:42 AM (in response to meetoblivion)1 of 1 people found this helpfulI just added a FAQ to answer your question.
http://community.jboss.org/wiki/infinispantechnicalfaqs#What_does_the_passivation_flag_do
-
7. Re: Persistent Caches - when do the contents get written.
amin59 Feb 2, 2010 11:18 AM (in response to manik)This link is also concise and helpful: http://docs.jboss.org/infinispan/4.0/apidocs/config.html1 of 1 people found this helpful