0 Replies Latest reply on Dec 19, 2008 12:35 PM by John Gerevich

    Advice needed on using Hibernate with Portlets

    John Gerevich Newbie

      I want to use a HibernateSession to store and retrieve my data.

      Question one: does opening and closing a Hibernate session 10 times introduce a drastic overhead compared to opening and closing it once? (In this scenario there can be a good few hundred concurrent users)

      If it does, how can I use one session for all portlets?

      Ex:

      HibernateSession gets opened();
      [Portlet1: processAction()]
      Portlet2: doView()
      Portlet1: doView()
      Portlet3: doView()
      ....
      HibernateSession gets closed();

      To put it another way:

      1. How can I run code BEFORE any portlet (processAction or doView) method gets called?

      2. How can I run code AFTER all (processAction and doView) methods have been called?


      Thanks,
      John