【问题标题】:Spring portlet ehcache delete cache on portlet undeploySpring portlet ehcache 删除 portlet 上的缓存 undeploy
【发布时间】:2013-06-06 16:27:24
【问题描述】:

我在 Liferay 环境 6.x 中使用 Spring portlet ehcache

如果我将 portlet war 放到部署文件夹中,则问题出在开发环境中。经过 3-4 次尝试后,它给了我 perm gen/ out of memory 异常。

如果我的 portlet 重新部署或取消部署删除缓存,我知道我可以通过调用 getCacheManager().remove("cacheKey"); 来删除缓存,但是当我应该调用它时,有什么想法如何将它与 portlet 实例挂钩?

提前致谢。

【问题讨论】:

    标签: portlet ehcache spring-portlet-mvc


    【解决方案1】:

    找到解决方案

    @PreDestroy
    public void cleanup() {
    
         getCacheManager().removeCache(KEY_SERVICE_CACHE);
         getCacheManager().removeCache(KEY_SOURCE_CACHE);
    
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多