This week's book giveaway is in the Agile and Other Processes forum.
We're giving away four copies of The Little Book of Impediments (e-book only) and have Tom Perry on-line!
See this thread for details.
Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Calling remove() on bean

 
Sany Bel
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
On page 559 of HFE book, it is mentioned that when a client calls remove() on a bean that's already been removed, clients get RemoteException/EJBException. But, I thought they should get NoSuchObjectException/NoSuchObjectlocalException.
However, on page 563 question #2 mentions that the clients will get
NoSuchObjectException/NoSuchObjectlocalException.
Which one is correct?
 
Roger Chung-Wee
Ranch Hand
Posts: 1683
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
NoSuchObjectException/NoSuchObjectlocalException are thrown when the client invokes a method on a bean which has been removed. This is not the same as a client calling remove() on a bean that's already been removed.
 
Sany Bel
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HFE page 559 says that remove() should be treated as any other business method.
 
Roger Chung-Wee
Ranch Hand
Posts: 1683
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is my understanding.
You get NoSuchObjectException thrown if the client tries to invoke a method by using a stub to the EJB Object which is not usable - gone, corrupt, whatever.
You get RemoteException thrown if the client, using a stub to a valid EJB Object, invokes remove or any other business method on a bean that's already been removed.
 
Dale Seng
Ranch Hand
Posts: 275
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Discussed with some good conclusions here.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic