List of usage examples for javax.persistence Cache evict
public void evict(Class cls);
From source file:com.haulmont.cuba.core.sys.QueryImpl.java
@Override public int executeUpdate() { JpaQuery<T> query = getQuery(); // In some cache configurations (in particular, when shared cache is on, but for some entities cache is set to ISOLATED), // EclipseLink does not evict updated entities from cache automatically. Cache cache = query.getEntityManager().getEntityManagerFactory().getCache(); Class referenceClass = query.getDatabaseQuery().getReferenceClass(); if (referenceClass != null) { cache.evict(referenceClass); } else {/*from w ww . j a va2 s . com*/ cache.evictAll(); } return query.executeUpdate(); }