As an alternative, I could write an HttpSessionListener implementation however since this is called by the container (configured in the web.xml file), I don't know how to access it from Flow.
This is one of those things that seems like it should be simple. Any ideas? Thanks in advance.
Mark Lundquist wrote:
On Aug 3, 2004, at 6:20 PM, Joel McConaughy wrote:
I would like to open one hibernate session for each user session and close it when the session is invalidated or times out. I can see how save the hibernate session in Flow using cocoon.session.setAttribute() and cocoon.session.getAttribute() however there doesn't seem to be a way to get notified when the session gets invalidated so I can close the hibernate session. Is there a way to do this?
Hi Joel,
Just curious, why do you want the Hibernate session to have the same lifetime as the user session? Typically, in a web application context a Hibernate session should be thought of as corresponding to a single HTTP request/reply.
See also this article: http://cocoon.apache.org/2.1/userdocs/forms/index.html
Actually, they make mention of the "session-per-user-session anti-pattern" at the end of that article...
Cheers, ~ml
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
