> 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 I scarcely need them. >> >>The only solution I found is to open a new Session, reload the object, and >>then load the children...
> I'm not a Hibernate expert by any means, but I think you would just > have to code around it. I've seen lots of things suggesting that > holding on to a Hibernate session for too long causes its own > problems, and if you scarcely need the children, you can probably > afford the overhead to get them explicitly when you need them. 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 HTH Carl-Eric -- Antwort: Weil es das Lesen des Textes erschwert. | Carl-Eric Menzel Frage : Warum ist das so schlimm? | PGP ID: 808F4A8E Antwort: Antworten oben zu schreiben. | Bitte keine HTML- Frage : Was ist die schlimmste Unsitte in Emails? | Mails schicken. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]