These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 
Author Message
 Post subject: Why do "session closed" exceptions need to be thro
PostPosted: Sat Jun 04, 2005 11:42 pm 
Regular
Regular

Joined: Tue Mar 01, 2005 2:35 pm
Posts: 60
When Hibernate notices that a session has been closed when lazy loading, why can't it just get a new one? That would save me a massive amount of hassle.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jun 04, 2005 11:56 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
The domain object might have been transported to an environment that is not hibernate aware, eg, Swing Client over CORBA, so it could not possibly work. There are quite a few approaches to manage this, eg, Web environment commonly uses a Filter to open and close the environment. Alternatively, you could always load what is required, sure you need to be more aware of whats going on after the domain object(s) become transient - which in my mind is a good thing.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jun 05, 2005 12:10 am 
Regular
Regular

Joined: Tue Mar 01, 2005 2:35 pm
Posts: 60
Yea, I have been using the one-session-per-request pattern, and that works great for model-2 frameworks, but I'm wondering how well that will transfer to a component based system where state is often maintained across requests.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jun 05, 2005 6:36 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
I am a heavy user of Tapestry and Hibernate through a EJB SLSB layer using a command pattern architecture. In this senario you are required to load what you need for the rendering process. Mostly this occurs in a single network fetch. Other options such as a wizard like operation, the detched session can work or using Transient object which are re-associated with the session (this I apply alot). Chapter 8 HIA has good coverage of the options.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jun 05, 2005 8:19 pm 
Regular
Regular

Joined: Tue Mar 01, 2005 2:35 pm
Posts: 60
I'll take another look at that chapter. Thank you.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.