aspose file tools*
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes Question from a Mock test Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "Question from a Mock test" Watch "Question from a Mock test" New topic
Author

Question from a Mock test

Sandesh Tathare
Ranch Hand

Joined: Jun 22, 2003
Posts: 82
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.


Regards,<br />Sandesh<br />(SCJCP, SCWCD, SCBCD - 99%, OCP-1)<br /> <br />Either find a way or create one.
Severin Stoeckli
Ranch Hand

Joined: Jul 21, 2004
Posts: 62
] 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
Valentin Crettaz
Gold Digger
Sheriff

Joined: Aug 26, 2001
Posts: 7610
Question from a Mock test

Which mock test is that?

PS: Mock exam authors like to get some credit for their hard work


SCJP 5, SCJD, SCBCD, SCWCD, SCDJWS, IBM XML
[Blog] [Blogroll] [My Reviews] My Linked In
Sandesh Tathare
Ranch Hand

Joined: Jun 22, 2003
Posts: 82
Valentin,

Sorry for replying late.

Question was from Mock test of ejbcertificate.com
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Question from a Mock test