This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes EJB and other Java EE Technologies and the fly likes Do references to Home timeout? plz urgent Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Do references to Home timeout? plz urgent" Watch "Do references to Home timeout? plz urgent" New topic
Author

Do references to Home timeout? plz urgent

Gul Khan
Ranch Hand

Joined: Sep 03, 2003
Posts: 173
hi all
I have a Thread running every 1 min and depending on some condition it is to access a session bean. to avoid creation and lookup for every sec i only lookup the first time and than store it in variables. for me there are two clear problems, one EJBObject reference im holding times out for that i am catching NoSuchObjectException and create the reference from the old Home reference i looked up when the thread run the first time.
I dont know whether my Home reference will be alive when i try to re-create the EJBObject from it?
My second question is what are better ways to cache my objects so i dont have to lookup and recreate them?
And will start running every day from morning to evening.. so every day in the morning all the objects will be recreated.
Thanks for any kind of Help/ Ideas
GUL
suresh koneru
Greenhorn

Joined: Apr 14, 2004
Posts: 2
Hi There,
Have you tried out EJBHomeFactory pattern .This might help you to solve your problem.
Gul Khan
Ranch Hand

Joined: Sep 03, 2003
Posts: 173
Thanks for the reply, can u plz give me a link to frind information about the pattern.
wei wu
Greenhorn

Joined: Apr 27, 2003
Posts: 23
http://www-900.ibm.com/developerWorks/cn/java/j-ejb0924/index_eng.shtml
Other than that, I think there is only one home instance for each EJB class.Look at javax.ejb.EJBMetaData and you will know this. So, the home instance never times out.
Gul Khan
Ranch Hand

Joined: Sep 03, 2003
Posts: 173
Thanks alot, it will solve my problem to great extent if the Home Reference does not time out.
GUL
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Do references to Home timeout? plz urgent