• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Do references to Home timeout? plz urgent

 
Ranch Hand
Posts: 173
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi There,
Have you tried out EJBHomeFactory pattern .This might help you to solve your problem.
 
Gul Khan
Ranch Hand
Posts: 173
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the reply, can u plz give me a link to frind information about the pattern.
 
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 173
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks alot, it will solve my problem to great extent if the Home Reference does not time out.
GUL
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic