• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Head First Java - Q3 & Q5 on Page 170, 171

 
sopal Pal
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
I have 2 questions regarding the answers given to Q3 and Q5.
1. For Q3 : Why is the 1st choice - R cannot pass his reference for A to B - True
According to me - Yes, R can surely pass the reference R has for A ( which is remote to R ) to B, but will it work for B when it tries to use it ??
2. For Q5 : The last option - To ask the EJBHome to remove a session bean, the client must provide the bean's handle - WHY Is it true
WHEN
- On Page 129 - where it discusses the methods in EJBHome - the 3rd point - clearly says that - "...passing the EJB Object's handle."
Is then the EJBObject's handle the same as the Bean's Handle.
I am confused ??
 
sopal Pal
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry the question should read as
1. For Q3 : Why is the 1st choice - R cannot pass his reference for A to B - FALSE
 
Walker Rustin
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In my opinion, one never gets a handle to the bean. One could only get the handle to the stub and that's why the handle has only getEJBObject() to get the reference to the stub back.
- walk rustin
 
Vishwa Kumba
Ranch Hand
Posts: 1066
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ur subject says, "Head First Java"?
http://www.coderanch.com/t/158671/java-EJB-SCBCD/certification/page
 
sopal Pal
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Vish
Thanks for forwarding the URL. That clears my doubts.
Also what about the Handle to the bean question ??
Thanks for your time and help
Sumit
 
Ramakrishna Allam
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For the question 5,
The EJBHome interface has 2 remove methods . one is remove(Handle) , and remove(Object pkey) . But Session beans do not have any primart key . So , we have to pass on a handle to remove method of the home in a session bean
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic