• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Bear Bibeault
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • salvin francis
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Frits Walraven
Bartenders:
  • Jj Roberts
  • Carey Brown
  • Scott Selikoff

Exceptions: Remove/Remote???

 
Ranch Hand
Posts: 173
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you call javax.ejb.EJBLocalHome.remove(java.lang.Object pk) on a session bean do you get a javax.ejb.RemoveException ( as stated on page 559 in HFEJB) OR javax.ejb.EJBException (Mock Answer to Q2 on www.ejbcertificate?)

The same confusion exists over calling javax.ejb.EJBHome.remove(java.lang.Object pk) on a session bean. Is it a java.rmi.RemoteException or a javax.ejb.RemoveException?

Any clarification here would be great!

Simon
 
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Simon,
I had the same confusion about the answer to this question in www.ejbcertificate.com and I reported them that the answer is incorrect. But I am not sure whether they corrected it.
Anyway, I think the correct answer is - a javax.ejb.RemoveException will be thrown in both the cases. Because what the spec says about this is the following

Remote Home Interface [Section 6.3.2 p59]
Because session objects do not have primary keys that are accessible to clients, invoking the javax.ejb.EJBHome.remove(Object primaryKey) method on a session results in the javax.ejb.RemoveException.

Local Home Interface [Section 6.4.2 p60]
Because session objects do not have primary keys that are accessible to clients, invoking the javax.ejb.EJBLocalHome.remove(Object primaryKey) method on a session results in the javax.ejb.RemoveException.

Hope this helps
Suman
 
Simon Ingram
Ranch Hand
Posts: 173
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks, Suman. It does help.
 
If you have a bad day in October, have a slice of banana cream pie. And this tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic