0 Replies Latest reply on Dec 9, 2010 11:13 AM by gwarden

    EhCache Clearing

    gwarden

      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" />
      


      The button simply looks like:
      <h:form>
         <h:commandButton id="update" value="#{messages.clearCache}" action="#{myClass.clearCache()}"/>
      </h:form>
      


      in the myClass function i have:
      @In EhCacheProvider cacheProvider;
      


      and the function looks like:
      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.