Thanks for this clarification Van.
I would just like to add an observation that I made when looking into
session management; there is another means by which hibernate sessions are
cleaned up in Mifos.
Struts action classes in mifos extend
org.mifos.framework.struts.action.BaseAction, which contains the method
postExecute(). This method is called after every struts action, and will
close the hibernate session if the calling method is annotated with the
org.mifos.framework.util.helpers.CloseSession interface... example from
SavingsAction below:
@CloseSession
@TransactionDemarcate(validateAndResetToken = true)
public ActionForward create(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws Exception {
// stuff ...
}
- Steve
On 15/02/2008, Van Mittal-Henkle <[EMAIL PROTECTED]> wrote:
>
> During a recent discussion regarding connection pooling, Hibernate
> session management and database connection management a suggestion was
> made about forcing the hibernate session to close at the end of each
> http request.
>
> I wanted to provide a reference to what is currently being done
> regarding this.
>
> Curently the class org.mifos.framework.ApplicationIntitializer (which
> implements ServletContextListener and ServletRequestListener) defines
> the following method:
>
> Public void requestDestroyed(ServletRequestEvent event) {
> HibernateUtil.closeSession();
> }
>
> The intent of this method is to force the current Hibernate session to
> close at the end of each request.
>
> This is not how we would like to ultimately manage sessions, but it was
> done as a stopgap measure to avoid sessions being left open in cases
> where they are not closed properly.
>
> --Van
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
>
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/