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
SCJP2,SCWD,SCBCD,IBM Certified SOA Associate,IBM Certified Architectural Design of SOA Solutions
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.
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
Run away! Run away! Here, take this tiny ad with you:
Devious Experiments for a Truly Passive Greenhouse!