• 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
  • Paul Clapham
  • Tim Cooke
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Frank Carver
  • Henry Wong
  • Ron McLeod
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Himai Minh

What is the need for EJB to get reference to Home interface?

 
Ranch Hand
Posts: 257
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
EJBContext.getEJBHome()/getEJBLocalHome are used to get ejb home.
Normally client uses home interface to get component interface and stub.

Then why EJB itself needs reference to EJB HOME?

Thanks,
Yamini
 
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by yamini nadella:
... Then why EJB itself needs reference to EJB HOME?



In one word, I would say efficiency.

1. Using home obtained in this way, you can make new beans of this type without doing JNDI lookup.
2. Also, you don't need JNDI lookup information
3. Even if you do have JNDI lookup information, calling getEJBHome() on the bean is more efficient.

See HFEJB page 137

Hope this helps
 
yamini nadella
Ranch Hand
Posts: 257
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
when client get need to create multiple bean of same type? is it for threads?
 
Ranch Hand
Posts: 161
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
.when client get need to create multiple bean of same type? is it for threads?

Even if you create multiple session/entity beans of the same type from a single thread, you still execute one bean at a time. It is not for threads.

If you submit jobs to a queue/totpic processed by message driven beans, then you can think that it is for threads since each of job can be processed independently.
 
snakes are really good at eating slugs. And you wouldn't think it, but so are tiny ads:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic