Hi Eric
I am just switching from EJB to Hibernate and I am interested to see how you
implemented that bean and would appreciate if you post that code.
My current very, very simple approach requires for every DB-access a new
Hibernate-session (they are light-weight) and then immediatly commits it.
regards
Roberto Saccon
> Luke-
>
> I created a helper bean to deal with Hibernate Sessions. One thing I
found
> is that the pageDetach event is not appropriate for committing & closing
> Hibernate Sessions in this type of situation:
>
> **Client End
> -User Fills out & submits a form
>
> **Server Side
> -Form fields values are set in the underlying page class
> -FormSubmit listener method is called in the underlying class
> -FormSubmit method obtains Hibernate Session & stores values
> -FormSubmit method uses cycle.setPage("Success"); to indicate success
>
> At this point, the pageDetach event is *not* raised for the current
> page. Instead, pageEndRender() is called for the current page and control
> passes to "Success". Thus, if you want to ensure that your Hib. Session
is
> committed and closed based on a page event, you need to use the
> pageEndRender() event.
>
> I can post the code for my helper class if you are interested - it allows
> you to obtain a session by calling getSession(IRequestCycle) and makes the
> assumption that it can find the SessionFactory as an attribute of the
> current ServletContext.
>
> Cheers,
>
> Eric Everman
>
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Tapestry-developer mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/tapestry-developer