Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Confusion regarding EJBObject??  RSS feed

 
Joe Harry
Ranch Hand
Posts: 10128
3
Eclipse IDE Mac PPC Ubuntu
  • Mark post as helpful
  • send pies
  • 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.
 
Prabhu Venkatachalam
Ranch Hand
Posts: 502
Java jQuery Spring
  • Mark post as helpful
  • send pies
  • 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 Harry
Ranch Hand
Posts: 10128
3
Eclipse IDE Mac PPC Ubuntu
  • Mark post as helpful
  • send pies
  • 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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!