Win a copy of Escape Velocity: Better Metrics for Agile Teams this week in the Agile and Other Processes forum!
  • 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
  • Liutauras Vilda
  • Tim Cooke
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Frank Carver
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • fred rosenberger

Context.lookup()

 
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
For EJB 1.0
To get EJB Object we use JNDI lookup
EJBHome = (EJBHome) contextLookp("EJBBean");
After using EJBHome object
1.Can I store the EJBHome object in a static variable of class(may be facade class) for future use thus avoiding lookup.
2. As i have stored in the static varible ,if I delete entry in the JNDI service,will i be able use EJBHome object stored in the variable.
 
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi..
1) yes you can certainly do this. In fact its recommended as JNDI lookup is costly.
for more information
http://www.precisejava.com/javaperf/j2ee/Patterns.htm#Patterns102
2) i too am not sure for this. May be someone here could help us ???
Regards
Anil
 
Cheers Prasad
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Anil, I will go thru the link.
To the query no 2,My understanding is that for JNDI lookup,EJB container returns remote stub which is proxy for the Home object to the client.
If I retain the stub (which delegates the request to the skeleton )and use it for future unless the location of EJB object in the server is changed.
Is my Understanding is right that JNDI services is not required once i get the home object.If it is true then even if i delete corresponding entry in JNDI services,my ejb object can be used.
Regards,
Prasad
 
anil bisht
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I too think the same.
As we already have the home interface and bean is not going to do the lookup again.
So even if the jndi-binding is removed it should work.
regards
Anil
 
Cheers Prasad
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Anil, Let me try it thru example.
Need Information
I am working in VAJ(Visual Age Environment).In VAJ all ejb objects when u create are automatically getting registered in JNDI services(Persistence server).I want to know how to get list of objects registered in persistence server.Is there any way i can go remove the registered objects from persistence server without removing the object.
Does VAJ put these information in any file?
Regards,
Prasad
 
permaculture is largely about replacing oil with people. And one tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic