ERROR [(org.hibernate.LazyInitializationException)] could not initialize proxy - the owning Session was closed
通过跟踪代码可以发现,在创建sessionfactory是在org.springframework.orm.hibernate3.LocalSessionFactoryBean中的 protected SessionFactory newSessionFactory(Configuration config) throws HibernateException {
return config.buildSessionFactory();
}
方法创建出来的。
对于外界提供sessionfactory和session是通过package org.springframework.orm.hibernate3.support. HibernateDaoSupport里提供出来。
包括主要的getSessionFactory,getSession,template相关,closesession等。