First, thank all for responding. I have further questions about "Open Session in View patter". (Please bare with me as I am a newbie in this area... )
pksiv wrote:
mappy wrote:
Hibernate version: I would suggest you look at using a ServletFilter to close your session. Check out this link for the Open Session in View pattern
http://www.hibernate.org/43.html
I am starting to look into this, but can't figure out how to correctly fire the servletfilter.... I have specified the filter and filter-mapping in web.xml but doesn't seem to execut the doFilter code.
I copied HibernateFilter code and is correctly compiled into the classpath of the web server.
Here's what I did in web.xml
<filter>
<filter-name>hibernatefilter</filter-name>
<filter-class>HibernateFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>hibernatefilter</filter-name>
<url-pattern>/*</url-pattern>
<dispatcher>REQUEST</dispatcher>
<dispatcher>FORWARD</dispatcher>
</filter-mapping>
..
09:43:43,968 ERROR LazyInitializationException:19 - could not initialize proxy - the owning Session was closed
org.hibernate.LazyInitializationException: could not initialize proxy - the owning Session was closed
at org.hibernate.proxy.AbstractLazyInitializer.initialize(AbstractLazyInitializer.java:53)
at org.hibernate.proxy.AbstractLazyInitializer.getImplementation(AbstractLazyInitializer.java:84)
at org.hibernate.proxy.CGLIBLazyInitializer.intercept(CGLIBLazyInitializer.java:134)
at com.adobe.automation.database.hibernate.TblProduct$$EnhancerByCGLIB$$d573865c.getTblProductConfiguration(<generated>)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.apache.commons.el.ArraySuffix.evaluate(ArraySuffix.java:314)
at org.apache.commons.el.ComplexValue.evaluate(ComplexValue.java:145)
at org.apache.commons.el.ExpressionEvaluatorImpl.evaluate(ExpressionEvaluatorImpl.java:263)
at org.apache.commons.el.ExpressionEvaluatorImpl.evaluate(ExpressionEvaluatorImpl.java:190)
at org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate(PageContextImpl.java:920)
at org.apache.jsp.common_005fjsp.feathome_jsp._jspx_meth_c_forEach_0(org.apache.jsp.common_005fjsp.feathome_jsp:248)
at org.apache.jsp.common_005fjsp.feathome_jsp._jspService(org.apache.jsp.common_005fjsp.feathome_jsp:171)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:99)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:325)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:245)
at javax.servlet.h