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

Confusion regarding EJBObject??

 
Ranch Hand
Posts: 10198
3
Mac PPC Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Guys,

There is a method in the EJBObject interface that says EJBHome getEJBHome(), I'm not able to understand how we can do this. How will the bean give a reference to its Home...Please anyone explain me.

Thanks in advance.
 
Ranch Hand
Posts: 502
jQuery Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Think about it, you got reference to EJBObject(component interface) through EJBHome. now you are in the middle of executing business method in that bean using EJBObject. Now think that you have lost reference to your EJBHome and you want to create another bean to do someother business operation. In this scenario, if this helper(getEJBHome()) method isn't there, again you need to go through JNDI to get reference to EJBHome. Intead you can use getEJBHome() method. This is the reason why? EJBObject has this getEJBHome() method.
 
Joe San
Ranch Hand
Posts: 10198
3
Mac PPC Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Prabhu,

Thanks for the explanation, could you please explain it using an example as I'm just a beginner in EJB. I would be very thankful to you if you can give me an exampled version of your above explanation.

Thanks in advance.
 
Every plan is a little cooler if you have a blimp. And a tiny ad.
Garden Master Course kickstarter
https://coderanch.com/t/754577/Garden-Master-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic