Michal Hlavac wrote:

Hello,

I am using tapestry 4. I created UniwebBasePage extends BasePage

there is method:

   protected Session session = null;

   public Session getSession() {
       if (session == null) {
           session = getHibernateGlobal().openSession();
           System.out.println("zakladam session");
           return session;
       } else {
           return session;
       }
   }

when I call from other pages, for example
LoginPage extends UniwebBasePage

public void test() {
 Session sess = getSession();
 Query q = ...
}

everything is ok, but I want to close session after every request.
Two questions:

1. Is this good performace step ( close hibernate session on every
request)??? If no, is there some any solutions?

2. if yes, how can I do that??

thanks, miso

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



You shold use hivemind ( which is integrated into T4 ) threaded service to create a Hibernate session for you.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to