my dog learned polymorphism*
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes Interesting Mock Exam Question - HFE 652 (Suman can you answer this) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "Interesting Mock Exam Question - HFE 652 (Suman can you answer this)" Watch "Interesting Mock Exam Question - HFE 652 (Suman can you answer this)" New topic
Author

Interesting Mock Exam Question - HFE 652 (Suman can you answer this)

mini mehta
Ranch Hand

Joined: Oct 22, 2000
Posts: 120
Which session bean component interface method(s) can be called successfully, by a local client.

A. remove()
B. getHandle()
C. isIdentical()
D. getEJBHome()


My Answers: A, B, C, D

Explaination : Local Client might have a remote component object, in that case it can see all the above methods and infact use it. In the question only the client is local not the component.

But the answer to this mock questions are given as A & C.

Does anybody knows why?

[ June 20, 2004: Message edited by: mini mehta ]
[ June 20, 2004: Message edited by: mini mehta ]
Muhammad Faisal
Greenhorn

Joined: Oct 14, 2002
Posts: 11
A. remove()
B. getHandle() --Wrong :In case of Local client you dont get any handle.
C. isIdentical()
D. getHome() -- Never heard of this method before. Nearest is getEJBHome().


SCWCD J2EE, OCP(Internet App Dev), SCJP 2
Suman Sarker
Ranch Hand

Joined: May 06, 2004
Posts: 68
Hi Mini,
Explaination : Local Client might have a remote component object, in that case it can see all the above methods and infact use it. In the question only the client is local not the component.

I think you are right. Although a remote interface can give out only remote component interface references and local home can give out only local component interfaces, I think local client can access a remote home without narrowing. So, I agree with you that all the options in the given question are correct.
Looking at the answer to this question, I can tell you that the question should rather look like the following -
"Which session bean local component interface method(s) can be called successfully, by a local client?"
But not to worry, as far as I know the questions in the real exam are stated very clearly. So, you are not likely to face this type of problem in the real exam.
Anyway, If you dont mind me asking, when is your exam due?
Regards
Suman


Suman A Sarker<br />SCJP, SCWCD, SCBCD<br /> <br />If You Can't Beat Them ... Join Them!
mini mehta
Ranch Hand

Joined: Oct 22, 2000
Posts: 120
Thanks Suman, great answer as always. My exam is on 26 June.
Suman Sarker
Ranch Hand

Joined: May 06, 2004
Posts: 68
Hi Mini,
I know you are studying hard to prepare yourself for the exam. Knowing that you have only a couple of days left to sit for the exam, I would like to give you just one more piece of information regarding the SCBCD exam. I think the objective of the exam that you might want to give a little more attention to is that of EJB-QL. The HFEJB book does not really cover it all when it comes to EJB-QL. The reason I am saying this is most people think ELB-QL is very easy. They under-estimate the importance of EJB-QL and eventually get a low score in it. I hope you wont make the same mistake.
Good luck
Suman
youngwoo seo
Greenhorn

Joined: May 28, 2004
Posts: 8
//////////////////////////////////////////////////////////////
Which session bean component interface method(s) can be called successfully, by a local client.

A. remove()
B. getHandle()
C. isIdentical()
D. getEJBHome()


My Answers: A, B, C, D

Explaination : Local Client might have a remote component object, in that case it can see all the above methods and infact use it. In the question only the client is local not the component.

But the answer to this mock questions are given as A & C.

Does anybody knows why?
//////////////////////////////////////////////////////////////////////////
I think the answer is A & C.

in EJBHome interface:
EJBMetaData getEJBMetaData(),
HomeHandle getHomeHandle(),
void remove(Handle) --> EJBLocalHome
void remove(Object key)

in EJBObject interface:
Object getPrimaryKey()
EJBHome getEJBHome()
Handle getHandle()
void remove()
boolean isIdentical

in EJBLocalObject interface;
Object getPrimaryKey()
EJBLocalHOme getEJBLocalHome()
void remove()
boolean isIdentical(Object o)

the session bean can call remove(Object key) on the EJBHome, but the container will throw RemoteException. remove(Object key) method is for only entity bean.
You have to know that the question is "called Successfully".
as u said, a & b& c&d(never seen)methods are called. but
for a, c is ok. but for b, there is no method named getHandle() in the EJBLocalObject interface. so it cause to throw an exception.

that's what i think that answer a,c is correct.
[ June 22, 2004: Message edited by: youngwoo seo ]
 
Don't get me started about those stupid light bulbs.
 
subject: Interesting Mock Exam Question - HFE 652 (Suman can you answer this)
 
Similar Threads
Bert's question #3.3 -- please explain!
Page 291 - ejbRemove method question
Couple of doubts in Session Bean
0.0d or 0.0f or 0 or 0.0????
Bean things in afterCompletion()