i'm using 2nd level cache and query cache. may i know how to programatically clear all caches?
+4
A:
To clear the session cache use session.clear()
To clear the 2nd level cache use this code snippet
Bozho
2010-03-17 09:33:53
+1
A:
If you plug in Terracotta, you also have the ability to run the Terracotta Dev Console which can inspect statistics about the cache, turn on and turn off the cache, and clear the cache contents from the user interface.
This functionality is also available from JMX beans.
Taylor Gautier
2010-03-17 20:10:15