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 and can be accessed many requests later...

That solution offers no help to beans which span multiple HTTP requests.


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.


Joe
--
Joe Germuska [EMAIL PROTECTED] http://blog.germuska.com "Imagine if every Thursday your shoes exploded if you tied them the usual way. This happens to us all the time with computers, and nobody thinks of complaining."
-- Jef Raskin


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



Reply via email to