Open Session in View Filter Spring Hibernate Struts
I am using OpensessionInViewFilter for hibernate 3 "org.springframework.orm.hibernate3.support.OpenSe ssionInViewFilter" and I keep getting the lazy initialization error.
Here is the filter configuration in web.xml:
<filter>
<filter-name>openSessionInViewFilter</filter-name>
<filter-class>
org.springframework.orm.hibernate3.support.OpenSes sionInViewFilter
</filter-class>
<init-param>
<param-name>singleSession</param-name>
<param-value>true</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>openSessionInViewFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
Here is the hibernate properties in the sessionFactory configuration:
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">
org.hibernate.dialect.SybaseDialect
</prop>
<prop key="show_sql">true</prop>
<prop key="hibernate.cache.use_second_level_cache">
false
</prop>
</props>
</property>
I am using declared transaction management and am unsure if this should matter or not.
I am also using struts and accessing the spring bean through struts. Note that I am not using spring through the struts plugin, but rather through the org.springframework.web.struts.DelegatingActionPro xy.
I would love some help. It sounds like this should work.
Is there a standard way to configure