Package javax.persistence

Examples of javax.persistence.Cache.evictAll()


        OperationStepHandler evictAllHandler = new AbstractMetricsHandler() {
            @Override
            void handle(final ModelNode response, final String name, ManagementLookup stats, OperationContext context) {
                Cache secondLevelCache = stats.getEntityManagerFactory().getCache();
                if (secondLevelCache != null) {
                    secondLevelCache.evictAll();
                }
            }
        };
        jpaHibernateRegistration.registerOperationHandler(OPERATION_EVICTALL, evictAllHandler, evictAll);
View Full Code Here


        OperationStepHandler evictAllHandler = new AbstractMetricsHandler() {
            @Override
            void handle(final ModelNode response, final String name, ManagementLookup stats, OperationContext context) {
                Cache secondLevelCache = stats.getEntityManagerFactory().getCache();
                if (secondLevelCache != null) {
                    secondLevelCache.evictAll();
                }
            }
        };
        jpaHibernateRegistration.registerOperationHandler(OPERATION_EVICTALL, evictAllHandler, evictAll);
View Full Code Here

    }
    query.executeUpdate();
    em.getTransaction().commit();
    Cache cache = emf.getCache();
    if (cache != null) {
        cache.evictAll();
    }
  }
}
View Full Code Here

        // Clear the L1
        em.clear();
       
        // Clear the L2 cache
        Cache cache = emf.getCache();
        cache.evictAll();
        assertFalse(cache.contains(CacheableEntity.class, ceid));

        // Find the entity, reloading it into the L2
        em.getTransaction().begin();
        ce = em.find(CacheableEntity.class, ceid);
View Full Code Here

        CacheableEntity ce = createEntity(em);
        int ceid = ce.getId();

        // Clear the L2 cache
        Cache cache = emf.getCache();
        cache.evictAll();
        assertFalse(cache.contains(CacheableEntity.class, ceid));

        // Find the entity, reloading it into the L2
        em.getTransaction().begin();
        ce = em.find(CacheableEntity.class, ceid);
View Full Code Here

        EntityManagerFactory entityManagerFactory = ctx.getBean(EntityManagerFactory.class);

        Cache cache = entityManagerFactory.getCache();

        if (cache != null) {
            cache.evictAll();
        }
    }

}
View Full Code Here

                    break;

                case ClearCache:
                    Cache cache = em.getEntityManagerFactory().getCache();
                    if (cache != null) {
                        cache.evictAll();
                    }     
                    break;

                case StartTx:
                    em.getTransaction().begin();
View Full Code Here

        OperationStepHandler evictAllHandler = new AbstractMetricsHandler() {
            @Override
            void handle(final ModelNode response, final String name, ManagementLookup stats, OperationContext context) {
                Cache secondLevelCache = stats.getEntityManagerFactory().getCache();
                if (secondLevelCache != null) {
                    secondLevelCache.evictAll();
                }
            }
        };
        jpaHibernateRegistration.registerOperationHandler(OPERATION_EVICTALL, evictAllHandler, evictAll);
View Full Code Here

   public final void evictCache(EntityManager em)
   {
      final Cache cache = em.getEntityManagerFactory().getCache();
      if (cache != null)
      {
         cache.evictAll();
      }
   }

}
View Full Code Here

        OperationStepHandler evictAllHandler = new AbstractMetricsHandler() {
            @Override
            void handle(final ModelNode response, final String name, ManagementLookup stats, OperationContext context) {
                Cache secondLevelCache = stats.getEntityManagerFactory().getCache();
                if (secondLevelCache != null) {
                    secondLevelCache.evictAll();
                }
            }
        };
        jpaHibernateRegistration.registerOperationHandler(OPERATION_EVICTALL, evictAllHandler, evictAll);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.