[jboss-user] [JBoss Portal] - Re: Hibernate Open Session In View (in Portlet)

2008-04-03 Thread EricML
The problem is, that you have an open session in the doView()-Method of the GenericPortlet. However, The strange thing is that the session is open as well in the jsp as my latest investigations have shown. These are the last lines of the doView-Method: | rResponse.setContentType(text/html);

[jboss-user] [JBoss Portal] - Re: Hibernate Open Session In View (in Portlet)

2008-03-26 Thread PMN
If you access an hibernate object outside the scope of the hibernate session where it has been loaded or saved, then before accessing a lazy property you have to open a new session and reattach the object to the new session. Check the hibernate session interface to do that - I believe it's

[jboss-user] [JBoss Portal] - Re: Hibernate Open Session In View (in Portlet)

2008-03-26 Thread EricML
Hi PMN, thanks for your suggestions, but I dont think that this would be the best way to handle it for several reasons: * Writing Java Code in a JSP is not recommended * Opening a new session and reattaching the objects in the JSP violates the MVC-pattern. * Performance will suffer a lot

[jboss-user] [JBoss Portal] - Re: Hibernate Open Session In View (in Portlet)

2008-03-26 Thread PMN
I am not an expert of JSP 186 but I would rather commit the transaction in processAction to let changes seen by other portlets that may use another session. An alternative to share an object outside the current session, why don't you reload it in the doView() ? Using a second level cache has