Currently my system pulls a list of reference values for drop downs into the EhCache at system start up. This is good, but I need to be able to update those lists without restarting the app. So I'm trying to add a button to a screen that will dump the cache. I've read through all the documentation I can find, tried dozens of things mentioned but nothing seems to actually be clearing the cache. I have it so no exceptions are being thrown, but the drop downs are not changing.
In components.xml the cache is defined by:
<cache:eh-cache-provider default-region="pageFragments" />
<h:form> <h:commandButton id="update" value="#{messages.clearCache}" action="#{myClass.clearCache()}"/> </h:form>
@In EhCacheProvider cacheProvider;
public void clearCache() { try { cacheProvider.clear(); statusMessages.add("Resourcebundle cache cleared"); } catch(Exception e) { statusMessages.add(StatusMessage.Severity.ERROR, "Could not clear resource bundle cache: {0}", e); } }
The success message is appearing on the page after the button is clicked. But the drop downs are not getting their options updated.