Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to clear ehcache without server restart

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: I am using apache-tomcat-5.5.25 Please let me know. Thanks, psvm

like image 831
Vishal Avatar asked Jun 06 '12 10:06

Vishal


1 Answers

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.

like image 51
jeha Avatar answered Sep 28 '22 02:09

jeha