线程多次使用getSession得到的是同一个session吗?

解决方案 »

  1.   

    Thanks for your replyBelow is HibernateDaoSupport 's getSession() APIprotected final Session getSession()
                                throws DataAccessResourceFailureException,
                                       IllegalStateException    Obtain a Hibernate Session, either from the current transaction or a new one. The latter is only allowed if the "allowCreate" setting of this bean's HibernateTemplate is "true".而HibernateTemplate. allowCreate 是默认值false.所以我确定getSession得到的是同一个session
      

  2.   

    Thanks for your replyBelow is HibernateDaoSupport 's getSession() APIprotected final Session getSession()
                                throws DataAccessResourceFailureException,
                                       IllegalStateException    Obtain a Hibernate Session, either from the current transaction or a new one. The latter is only allowed if the "allowCreate" setting of this bean's HibernateTemplate is "true".而HibernateTemplate. allowCreate 是默认值false.所以我确定getSession得到的是同一个session