public class HibernateSessionFactory {
private static SessionFactory sessionFactory;
public synchronized static Session openSession_db1() throws HibernateException {
if (sessionFactory == null) {
init_db1();
}
return sessionFactory.openSession();
}
private static SessionFactory sessionFactory;
public synchronized static Session openSession_db1() throws HibernateException {
if (sessionFactory == null) {
init_db1();
}
return sessionFactory.openSession();
}
Tags: 多数据库