session.close(); sessionFactory().getCache().evictEntityRegion( Product.class ); sessionFactory().getCache().evictEntityRegion( Part.class );
s.close(); sessionFactory().getCache().evictEntityRegion( Organization.class ); sessionFactory().getCache().evictEntityRegion( Person.class ); sessionFactory().getCache().evictEntityRegion( Employment.class );
session.close(); sessionFactory().getCache().evictEntityRegion(Product.class); sessionFactory().getCache().evictEntityRegion(Part.class); session.close(); sessionFactory().getCache().evictEntityRegion( Product.class ); sessionFactory().getCache().evictEntityRegion(Part.class);
s.close(); sessionFactory().getCache().evictEntityRegion( I.class ); s.close(); sessionFactory().getCache().evictEntityRegion( I.class ); s.close(); sessionFactory().getCache().evictEntityRegion( I.class ); s.close(); sessionFactory().getCache().evictEntityRegion( I.class ); s.close(); sessionFactory().getCache().evictEntityRegion( I.class ); s.close(); sessionFactory().getCache().evictEntityRegion( I.class );
s.close(); sessionFactory().getCache().evictEntityRegion(Glarch.class); s.close(); sessionFactory().getCache().evictEntityRegion(Glarch.class);
sessionFactory().getCache().evictEntityRegion( Being.class ); Being gav = (Being) s.get(Being.class, gavin.getId()); assertEquals( gav.getLocation(), gavin.getAddress() );
s.close(); sessionFactory().getCache().evictEntityRegion(Foo.class);
assertEquals(0, sessionFactory().getStatistics().getUpdateTimestampsCacheMissCount()); sessionFactory().getCache().evictEntityRegion( "Item" ); TestingJtaPlatformImpl.INSTANCE.getTransactionManager().commit(); sessionFactory().getCache().evictEntityRegion( "Item" );
sessionFactory().getCache().evictEntityRegion( Account.class ); sessionFactory().getCache().evictEntityRegion( Person.class );
sessionFactory().getCache().evictEntityRegion( Account.class ); sessionFactory().getCache().evictEntityRegion( Person.class );
@Test public void testOneToOneCache() throws HibernateException { //create a new MainObject createMainObject(); // load the MainObject readMainObject(); //create and add Ojbect2 addObject2(); //here the newly created Object2 is written to the database //but the MainObject does not know it yet MainObject mainObject = readMainObject(); assertNotNull( mainObject.getObj2() ); // after evicting, it works. sessionFactory().getCache().evictEntityRegion( MainObject.class ); mainObject = readMainObject(); assertNotNull( mainObject.getObj2() ); }
sessionFactory().getCache().evictEntityRegion( "Item" );