环境:
我使用org.springframework.orm.hibernate4.support.OpenSessionInViewFilter实现了Spring OpenSessionInViewFilter
但是,我仍然收到错误:
org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role
我知道正在调用过滤器 - 我可以在堆栈跟踪中看到它。我还需要配置什么? Hibernate配置包括以下内容:
<property name="hibernate.dialect">org.hibernate.dialect.SQLServer2005Dialect</property>
<property name="hibernate.hbm2ddl.auto">update</property>
<property name="hibernate.current_session_context_class">jta</property>
<property name="hibernate.transaction.manager_lookup_class">org.hibernate.transaction.SunONETransactionManagerLookup</property>
<property name="hibernate.transaction.factory_class">org.hibernate.transaction.JTATransactionFactory</property>