Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Question from a Mock test

 
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Question:
---------
Identify how a client can obtain a reference to an existing entity object's remote interface? [Check all correct answers]

1. Invoke the findByPrimaryKey() finder method.
2. Invoke the getHandle() method on the remote interface.
3. Call a create() method on the remote interface.
4. Execute a home business method that returns the reference.
5. Call the getRef() method on the remote interface.

I answered: only 1 - This is incorrect
My Reasoning is as below:
To me answer 2 was wrong, because getHandle() returns Handle and not EJBObject. I know one can get EJBObject from Handle. Another point is we are calling getHandle() on EJBObject which itself is entity object's remote interface. So what's the point in doing it.

Explaination:
-------------
Answer 1, 2 and 4 are correct.
Answer 3 is incorrect, the create() method will not return a reference to an existing entity object's remote interface.
Answer 5 is incorrect, this method does not exists.

A client can get a reference to an existing entity object's remote interface in any of the following ways:

* Receive the reference as a parameter in a method call.
* By using a finder method defined in the entity bean's remote home interface.
* By obtaining the reference from the entity object's handle.


My Doubt:
---------
1] Can Home Business method return an EJB Object reference?

2] Whether actual exam would have ambiguous questions like above.
 
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
] Can Home Business method return an EJB Object reference?

Why not?

spec 10.6.6:

If the ejbHome<METHOD>(...) method corresponds to a home <METHOD>(...) on the entity
bean�s remote home interface, the method argument and return value types must be legal types for
RMI-IIOP.


Severin
 
Author & Gold Digger
Posts: 7617
6
IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Question from a Mock test

Which mock test is that?

PS: Mock exam authors like to get some credit for their hard work
 
Sandesh Tathare
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Valentin,

Sorry for replying late.

Question was from Mock test of ejbcertificate.com
 
Consider Paul's rocket mass heater.
    Bookmark Topic Watch Topic
  • New Topic