• 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

How JNDI cache works?

 
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am trying to lookup an ejb through a servlet using fully qualified class name of the ejb for lookup.
Something like this ejb/com/MyEJBHome. This I am doing in Websphere.
And it does work fine.

I have read following "When an InitialContext object is instantiated, an association is established between the InitialContext instance and a cache" from http://publib.boulder.ibm.com/infocenter/wasinfo/v6r0/index.jsp?topic=/com.ibm.websphere.express.doc/info/exp/ae/cnam_naming_caching.html

Now if i try to lookup that same ejb again (using same context Factory and fully qualified classname of the ejb) through a standalone client will the lookup happen through the cache?

Regards,
Giriraj.
 
Giriraj Bhojak
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Here is what I have done meanwhile.



I used above code twice.
Once inside a servlet and once inside a standalone java app.

Now the server is up and i run the servlet. I get the object reference "ejbHome " as in the snippet above.

Now i run the standlone java app.
Again i get the object reference and i compare it with the one i got while invoking through a servlet.
And they turn out to be same.(something like IOR:00bdbdbd00000039524d493a636f6d2e73312e617263682e616c65727 etc...)

Can i conclude from this that next time the lookup happened through the cache?

Regards,
Giriraj.
 
When evil is afoot and you don't have any arms you gotta be hip and do the legwork, but always kick some ... tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic