• 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:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Junilu Lacar
  • Liutauras Vilda
Sheriffs:
  • Paul Clapham
  • Jeanne Boyarsky
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
Bartenders:
  • Jesse Duncan
  • Frits Walraven
  • Mikalai Zaikin

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

 
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 1066
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ur subject says, "Head First Java"?
https://coderanch.com/t/158671/java-EJB-SCBCD/certification/page
 
sopal Pal
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
pie. tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic