Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Question on EJBObject

 
B.Sathish
Ranch Hand
Posts: 372
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The 2nd chapter in HFEJB says that the Home object creates the EJB Object instance. I thought the container creates the instance when the client calls home.create(). I am confused - will the home object have the code to create an instance of EJBObject or will the container create it?
 
Peer Reynders
Bartender
Posts: 2968
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by B Sathish:
I am confused - will the home object have the code to create an instance of EJBObject or will the container create it?


Same difference. You only provide the home interface. The container implements the home class. So in effect running the home object's code is the container doing something.
[ October 03, 2005: Message edited by: Peer Reynders ]
 
Narayan R
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The home.create() method tell container to make the instance. See the concrete implimentation of home interface, it have a command like container.preInvoke(this, ...), so the Contianer still bosses the EJBObject instance.
 
B.Sathish
Ranch Hand
Posts: 372
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks, got it now. I overlooked the fact that the container runs the home object code
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic