List of usage examples for org.hibernate.engine.spi SessionFactoryImplementor getStatistics
@Override
StatisticsImplementor getStatistics();
From source file:org.infinispan.test.hibernate.cache.commons.functional.JndiRegionFactoryTest.java
License:LGPL
private void addEntityCheckCache(SessionFactoryImplementor sessionFactory) throws Exception { Item item = new Item("chris", "Chris's Item"); withTxSession(s -> s.persist(item)); withTxSession(s -> {//from w ww . java2 s . c o m Item found = s.load(Item.class, item.getId()); Statistics stats = sessionFactory.getStatistics(); log.info(stats.toString()); assertEquals(item.getDescription(), found.getDescription()); assertEquals(0, stats.getSecondLevelCacheMissCount()); assertEquals(1, stats.getSecondLevelCacheHitCount()); s.delete(found); }); }