• 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:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Tim Cooke
  • Bear Bibeault
  • paul wheaton
Saloon Keepers:
  • Carey Brown
  • Stephan van Hulst
  • Tim Holloway
  • Mikalai Zaikin
  • Piet Souris
Bartenders:

HF Book Doubt on Exception

 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
On P 559 Client Scenarios (1) says the exception will be RemoteException for Remote i/f and EJBException for local when client calls a remove on an already removed bean.My doubt is why the NoSuchObjectException is not thrown ?

What are conditions under which it is thrown then because as per the book it is thrown when the client invokes a method on a home or component i/f when there is no underlying bean to support the object


Please clarify
 
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Only container can throw NoSuchEntityException but client will not able to see it ever.

Calling remove() on a bean already removed is just any other method called on bean e.g. create, getHome etc. and all get RemoteException for remote client and EJBException for local clients.

Imran
 
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I too think the NoSuchObjectException and NoSuchObjectLocalExcecption should be thrown. However in a question if these exceptions are not available, then it would not be wrong to say RemoteException (or EJBException) will be thrown because these are the parent classes.

The NoSuchEntityException Imran is talking about is something that you can throw from your bean method when you find that the underlying entity is no longer in the database(typically used in BMP entity beans). This will be rethrown by the container as a NoSuchObjectExcecption.
 
permaculture is giving a gift to your future self. After reading this tiny ad:
Low Tech Laboratory
https://www.kickstarter.com/projects/paulwheaton/low-tech-0
reply
    Bookmark Topic Watch Topic
  • New Topic