Oct 10, 2018

[HDGEM] How to clear JPA 2nd level cache

You can clear JPA 2nd level cache with:
em.getEntityManagerFactory().getCache().evictAll();
You can also evict individual objects with the evict(java.lang.Class cls, java.lang.Object primaryKey) call:
em.getEntityManagerFactory().getCache().evict(theClass, thePrimaryKey);


--
Posted By Blogger to HDGEM at 2/23/2017 11:54:00 AM