3

Recently uses the secondary level cache in my project there
is some issue with it , i wanted to know how can i clear it secondary cache

Ashish Chaurasia
  • 1,747
  • 17
  • 23

1 Answers1

8

If you want to clear cache in code you can use:

sf.getCache().evictEntityRegions()
sf.getCache().evictCollectionRegions()
sf.getCache().evictDefaultQueryRegion()
sf.getCache().evictQueryRegions() 

where sf means session factory

michal
  • 1,796
  • 1
  • 13
  • 11