• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

mock exam question

 
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
b,c,e
The PK doesnt have to be a String
Regards,
Chris Lewold
 
Ranch Hand
Posts: 1312
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
b, c, d and e
 
Bartender
Posts: 1872
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
b,c,d and e are correct answers.
Dilli
[ February 01, 2004: Message edited by: Dilli raj ]
 
Cowgirl and Author
Posts: 1589
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
reply
    Bookmark Topic Watch Topic
  • New Topic