RE: Tapestry Hibernate Session Extension
"Luke Galea" <[email protected]> Tue, 11 Feb 2003 15:37:39 -0500
| Newsgroups | gmane.comp.java.tapestry.devel |
|---|---|
| Message-ID | <[email protected]> |
Eric, I was having a few probs with my solution to the Hibernate/Tapestry session issue.. so I took a look at your code. It doesn't seem to work for me because the page is null in the call to cycle.getPage() in createSession(). A bigger question here is: If I have a hibernate collection in my visit object.. and you move from one page to another, the session is closed and another is created.. The problem case is: Page 1 sets a value in the visit using a session, page 2 access this value.. but it now has it's own new session.. this causes an error because the object shouldn't be accessed outside of the context of the first session. Ie. Login page grabs user object, forwards user on to main page.. which updates the user's lastAccessed field and updates the database (using a new session). So the question is.. is there any way to have a listener that is informed when the request is complete instead of the page??? Thanks in advance Luke Galea Software Development BlueCat Networks 905-762-5225 -----Original Message----- From: Eric Everman [mailto:[email protected]] Sent: November 25, 2002 2:39 PM To: Howard M. Lewis Ship; [email protected] Subject: [Tapestry-developer] Tapestry Hibernate Session Extension Howard- Thanks for the suggestion. I guess I missed the fact that there was such a thing as an extension. For anyone interested, attached is a Tapestry Extension helper bean which creates Hibernate Sessions on demand. Setup and use info is in the class javadocs. It does make some assumptions about how you configure Hibernate and how you use Sessions, so it is not a be-all solution. Suggestions or questions are welcome, Eric Everman At 11/24/2002, Howard M. Lewis Ship wrote: >I took a *very* cursory look at this. Have you considered using the >Tapestry <extension> mechanism to support this? It is a more natural way to >provide global resources to applications and doesn't require subclassing the >ApplicationServlet. ------------------------------------------------------- This SF.NET email is sponsored by: SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See! http://www.vasoftware.com