-->
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.  [ 6 posts ] 
Author Message
 Post subject: Lifecyle method invocations
PostPosted: Fri Dec 26, 2003 6:45 am 
Newbie

Joined: Mon Oct 13, 2003 8:59 am
Posts: 3
Location: Hyderabad
When will the Lifecycle methods exactly called? In the reference document, at one place it says, onSave() & onLoad() called after saving and loading. At another place, it says, only onLoad() is called after Loading. Which is correct?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 26, 2003 7:10 am 
Expert
Expert

Joined: Tue Sep 16, 2003 4:06 pm
Posts: 318
Location: St. Petersburg, Russia
Fitst.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 26, 2003 11:03 am 
Regular
Regular

Joined: Thu Dec 25, 2003 12:33 am
Posts: 58
Location: Campina Grande, Brasil
This issue seems to be useful for me. is the lifecycle interface the one we should implement if we are trying to keep a session opened until the viex tier uses it? I mean, should we use it to avoid the Lazy instantiation exception? Well,if that is the case, I'd like to know what to implement inside the onLoad() method.

thanks

Ot


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 26, 2003 11:11 am 
Expert
Expert

Joined: Tue Sep 16, 2003 4:06 pm
Posts: 318
Location: St. Petersburg, Russia
To avoid lazy initialization exception you need not to close session while it is needed :) If you are building web application, consider using Filter and ThreadLocal pattern.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 26, 2003 11:25 am 
Regular
Regular

Joined: Thu Dec 25, 2003 12:33 am
Posts: 58
Location: Campina Grande, Brasil
yeah, I already knew that about not closing the session until it is needed. And yes, I'm building a web application (my first one with hibernate). if u could show me some resources (liks, tutorials) about how to use filters and threadlocal, ithat'd be great for me.

thanks again. do u ever sleep? :P


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 26, 2003 11:37 am 
Expert
Expert

Joined: Tue Sep 16, 2003 4:06 pm
Posts: 318
Location: St. Petersburg, Russia
http://www.hibernate.org/43.html

http://www.hibernate.org/42.html

http://forum.hibernate.org/viewtopic.php?t=926545


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 6 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.