一般是根据SessionFactory来获取当前的Session ,SessionFactory().getCurrentSession()。
连接池的话 使用getSession();
那如果有多个连接暂时的放到内存当中,那么就构成了连接池,当多个用户访问的时候,可以一个用户分配一个,这样的速度快还是一个一个的速度快呢
Session session = this.getHibernateTemplate().getSessionFactory().openSession();