This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes mock exam question 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 "mock exam question" Watch "mock exam question" New topic
Author

mock exam question

bhargavi kakarala
Ranch Hand

Joined: Jan 03, 2002
Posts: 82
hi all,
which interface and methods could u use to remove an EJB object?
a)EJBHome.remove()
b)EJBHome.remove(Handle handle)
c)EJBHome.remove(Object object)
d)EJBHome.remove(String PrimarKey)
e)EJBObject.remove()
f)EJBObject.remove(Handle handle)
g)EJBObject.remove(Object object)
h)EJBObject.remove(String PrimarKey)
what r the answers for this question.my answers r b,d,e


Bhargavi
SCJP2,SCWD,SCBCD,IBM Certified SOA Associate,IBM Certified Architectural Design of SOA Solutions
Chris Lewold
Greenhorn

Joined: Dec 16, 2003
Posts: 25
b,c,e
The PK doesnt have to be a String
Regards,
Chris Lewold
somkiat puisungnoen
Ranch Hand

Joined: Jul 04, 2003
Posts: 1312
b, c, d and e


SCJA,SCJP,SCWCD,SCBCD,SCEA I
Java Developer, Thailand
Philippe Maquet
Bartender

Joined: Jun 02, 2003
Posts: 1872
Hi bhargavi,
I'd reply b, c, e. But the question is a bit confusing : d would be correct if you declared an overloaded remove() method in your home interface. But it wouldn't be EJBHome anymore but MyHome...
Best,
Phil.
Dilli raj
Greenhorn

Joined: Jan 31, 2004
Posts: 24
b,c,d and e are correct answers.
Dilli
[ February 01, 2004: Message edited by: Dilli raj ]

SCJP,SCWCD,SCBCD
Kathy Sierra
Cowgirl and Author
Ranch Hand

Joined: Oct 10, 2002
Posts: 1572
Howdy -- yes, I agree with Philippe and Chris -- there is *no* remove() that takes a String in EJBHome. It's kind of a good tricky question though, because we see (and use) so many examples where String is the primary key type, that it's easy to believe that there's a remove that takes a String. And the question is also making sure that you understand two important points about remove:
1). that remove() in the component interface does *not* take any arguments, because you're always telling the container to remove the object on which you invoked remove().
2). that remove() in the home interface MUST take arguments, since there would be no way for the container to know WHICH bean from that home you're trying to remove.
So... bottom line:
1) remove in the component interface NEVER takes arguments
2) remove in the home takes arguments... but it depends:
A) in the Remote home, there is a remove() that takes an Object (for the primary key) AND a remove() that takes a Handle)
B) in the local home, there is *only* a remove() that takes an Object, because Handles do not apply with local interfaces (which of course *also* means that you cannot use a local Home to remove a Session bean! Since session beans don't have keys...)
Cheers,
Kathy
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: mock exam question
 
Similar Threads
EJBHome.remove
Chapter 3 - HF Sark study group
What's different between remove(para) of EJBHome and remove( ) of EJBRemote??
remove method + transaction attribute
about EJBHome.remove