Win a copy of AWS Security this week in the Cloud/Virtualization forum!
  • 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
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

Calling remove() on bean

 
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?
 
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.
 
Ranch Hand
Posts: 275
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Discussed with some good conclusions here.
 
Catch Ernie! Catch the egg! And catch this tiny ad too:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic