• 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
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Devaka Cooray
  • Ron McLeod
  • paul wheaton
Saloon Keepers:
  • Tim Moores
  • Piet Souris
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Frits Walraven
  • Scott Selikoff

ejb-ref and ejb-local-ref

 
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What is the difference between these two and Why do they have both?
what do they mean by Local?
Thanks
Mark
 
Ranch Hand
Posts: 236
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Mark,
If you have worked on EJB , then you will know that there is a EJBHome and EJBObject interfaces,which are implemented by the EJB container.If the client (say a servlet or jsp) wants to communicate with the EJB then they do it with the help of stubs and skeletons.So the calls are basically remote calls.If the client and the enterprise beans are in the same machine running in the same process then there is no need of the client making remote calls to the EJB's if it implements a EJBLocal interface.This interface is implemented by the EJB container very much like the Home and Remote interfaces,so that the client can make local calls instead of remote calls.
The concept of stubs,skeletons,marshalling and unmarshalling doesn't come in the picture.
This increases the performance of the system
If the client is going to make a call on an object which implements the EJBLocal interface then use the ejb-local-ref in the DD.Else if the client is invoking a method call on a EJBObject stub then use the ejb-ref in the DD.
Hope this helps,
Manjunath
 
Mark Spritzler
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks.
But I had thought that they always placed the Home object on the JNDI tree, and that you still had to "Connect" to the application server. So by implementing the LocalHome interface the application server knows not to create the stubs and skeletons? hmm pretty interesting.
Mark
 
Something about .... going for a swim. With this tiny ad ...
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic