sessionFactory3 = ClusterJHelper.getSessionFactory(modifiedProperties);
errorIfNotEqual(where + " SessionFactory1 should be the same object as SessionFactory2", true,
sessionFactory1 == sessionFactory2);
errorIfNotEqual(where + " SessionFactory1 should be the same object as SessionFactory3", true,
sessionFactory1 == sessionFactory3);
Session session1 = sessionFactory1.getSession();
Employee e1 = session1.find(Employee.class, 0);
checkSessions(where + " after get session1", sessionFactory1, new Integer[] {1, 0});
Session session2 = sessionFactory1.getSession();
Employee e2 = session2.find(Employee.class, 0);
checkSessions(where + " after get session2", sessionFactory1, new Integer[] {1, 1});
Session session3 = sessionFactory1.getSession();
checkSessions(where + " nafter get session3", sessionFactory1, new Integer[] {2, 1});
Session session4 = sessionFactory1.getSession();
checkSessions(where + " after get session4", sessionFactory1, new Integer[] {2, 2});
Session session5 = sessionFactory1.getSession();
checkSessions(where + " after get session5", sessionFactory1, new Integer[] {3, 2});
Session session6 = sessionFactory1.getSession();
checkSessions(where + " after get session6", sessionFactory1, new Integer[] {3, 3});
session1.close();
checkSessions(where + " after close session1", sessionFactory1, new Integer[] {2, 3});
session4.close();
checkSessions(where + " after close session4", sessionFactory1, new Integer[] {2, 2});
session5.close();
checkSessions(where + " after close session5", sessionFactory1, new Integer[] {1, 2});
Session session7 = sessionFactory1.getSession();
checkSessions(where + " after get session7", sessionFactory1, new Integer[] {2, 2});
session2.close();
session3.close();
session6.close();
session7.close();
sessionFactory1.close();
}