Fixed hang in Hibernate example (caused by not closed SessionFactory).
@@ -125,8 +125,7 @@ public class HibernateL2CacheExample {
) {
URL hibernateCfg = ExamplesUtils.url(HIBERNATE_CFG);
- SessionFactory sesFactory = createHibernateSessionFactory(hibernateCfg);
-
+ try (SessionFactory sesFactory = createHibernateSessionFactory(hibernateCfg)) {
System.out.println();
System.out.println(">>> Creating objects.");
@@ -191,6 +190,7 @@ public class HibernateL2CacheExample {
// a miss.
printStats(sesFactory);
}
+ }
finally {
// Distributed cache could be removed from cluster only by #destroyCache() call.
ignite.destroyCache(UPDATE_TIMESTAMPS_CACHE_NAME);
