• 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

session bean exception

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
On page 130 of head first EJB it is mentioned that if a session bean client calls remove(Object primaryKey) then the client gets a javax.ejb.RemoveException

However the API defines remove as :
public void remove(java.lang.Object primaryKey)
throws java.rmi.RemoteException,RemoveException

and its description says:
"Remove an EJB object identified by its primary key.
This method can be used only for an entity bean. An attempt to call this method on a session bean will result in a RemoteException."

Is this an error or is it something I am missing?I did not find it in March 18, 2005 errata as well.
 
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think it has got something to do with what is explained in Page 545. Please read on and tell me if that is so. And after that I think if you could refer to page 59 of specification which states that:


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.

 
Ranch Hand
Posts: 1683
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The client will get a RemoveException. Remember, the EJB spec is the authority (and on which you will be tested), so overrules anything contrary in the API documentation.
 
Slideshow boring ... losing consciousness ... just gonna take a quick nap on this tiny ad ...
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic