Re: Re[2]: Struts and Hibernate Session

2004-05-05 Thread Lionel
Carl-Eric Menzel wrote: > It is possible to reassociate an object from an older session with the > current session by using the Session.lock() method. See > > http://www.hibernate.org/hib_docs/reference/en/html/manipulatingdata.html#manipulatingdata-update-lock > GREAT !! This is EXACTLY what

Re[2]: Struts and Hibernate Session

2004-05-05 Thread Carl-Eric Menzel
> At 1:57 PM +0200 5/5/04, Lionel wrote: >>The problem is that when I load an object, put the object into HttpSession, >>close the hibernate Session. >>If later I call a getter on lazy loaded children, I get a LazyException, >>connection closed >>I want to keep the children lazy loaded because

Re: Struts and Hibernate Session

2004-05-05 Thread Joe Germuska
At 2:10 PM +0200 5/5/04, Lionel wrote: Nicolas de Amorrortu wrote: Have you tried the following? http://www.hibernate.org/43.html. this is what I was thinking about when I posted my question...but haven't tried it yet. I don't think it will solve my problem as the object I load is put in session a

Re: Struts and Hibernate Session

2004-05-05 Thread Lionel
Nicolas de Amorrortu wrote: > Have you tried the following? http://www.hibernate.org/43.html. this is what I was thinking about when I posted my question...but haven't tried it yet. I don't think it will solve my problem as the object I load is put in session and can be accessed many requests late

RE: Struts and Hibernate Session

2004-05-05 Thread Nicolas de Amorrortu
Have you tried the following? http://www.hibernate.org/43.html. Regards, Nicolás -Original Message- From: news [mailto:[EMAIL PROTECTED] On Behalf Of Lionel Sent: Miércoles, 05 de Mayo de 2004 08:58 a.m. To: [EMAIL PROTECTED] Subject: Re: Struts and Hibernate Session Joe Germuska wrote

Re: Struts and Hibernate Session

2004-05-05 Thread Lionel
Joe Germuska wrote: >> Acutally, I have put the getHibernateSession() on a ActionFormBase. >> After each SQL action (load, find...) I close the Session. >> I don't believe this is a good design and would like to improve it. > > This is actually how Hibernate is meant to be used. The session > lif

Re: Struts and Hibernate Session

2004-05-05 Thread Joe Germuska
Where is the best way to keep the current opened Hibernate Session ? -in the HttpSession of each user ? -in a singleton ? -... When to close this Session ? -after each request ? -when the HttpSession closes ? -... Acutally, I have put the getHibernateSession() on a ActionFormBase. After each SQL ac

RE: Struts and Hibernate Session

2004-05-05 Thread Marco Mistroni
- From: news [mailto:[EMAIL PROTECTED] On Behalf Of Lionel Sent: 05 May 2004 11:31 To: [EMAIL PROTECTED] Subject: Struts and Hibernate Session Hi ! I use struts 1.2 and Hibernate on Websphere 5. I use the struts plugin to store the SessionFactory on applicaiton context. Where is the best way to keep

Struts and Hibernate Session

2004-05-05 Thread Lionel
Hi ! I use struts 1.2 and Hibernate on Websphere 5. I use the struts plugin to store the SessionFactory on applicaiton context. Where is the best way to keep the current opened Hibernate Session ? -in the HttpSession of each user ? -in a singleton ? -... When to close this Session ? -after each