如何在没有服务器重启的情况下清除ehcache [英] How to clear ehcache without server restart
问题描述
虽然我猜它极不可能 - 但有没有办法在不重新启动服务器的情况下清除ehcache?
我需要清除缓存以进行一些测试 - 我无法更改代码,也无法多次重启服务器。
Though I guess its highly unlikely - but is there any way to clear the ehcache without restarting the server? I need to clear the cache for some testing - I cannot change the code and cannot afford to restart server at multiple times.
PS:我使用的是apache-tomcat-5.5.25
请告诉我。
谢谢,
psvm
PS: I am using apache-tomcat-5.5.25 Please let me know. Thanks, psvm
推荐答案
您是否通过JMX公开Ehcache?然后,您可以使用JMX操作清除缓存,例如使用jvisualvm。寻找像 net.sf.ehcache.CacheManager
这样的MBean,它提供 clearAll()
操作。
Do you expose Ehcache via JMX? Then you could clear the cache using JMX operations by using a tool like e.g. jvisualvm. Look for MBeans like net.sf.ehcache.CacheManager
which provide a clearAll()
operation.
这篇关于如何在没有服务器重启的情况下清除ehcache的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!