• 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

Thorwn Exception of local

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
From Q3 HFEJB Page 425
When a remote client invokes a method on an entity bean using container-managed persistence, and that bean has already beean removed ,what exception will be thrown?
ans java.rmi.NoSuchObjectException

As case.If local client called method ? what exception will be thrown?

would you please advice me
Thank a lot for your kindly advice
 
Ranch Hand
Posts: 211
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
javax.ejb.NoSuchObjectLocalException
 
Ranch Hand
Posts: 162
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
local clients will get javax.ejb.NoSuchObjectLocalException
remote clients will get javax.ejb.NoSuchObjectException

Bye
Amol.
 
Ranch Hand
Posts: 884
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

HJEJB Page 425, Question 3:
When a remote client invokes a method on an entity bean using container-managed persistence, and that bean has already been removed, what exception will be thrown?



I'm not challenging the provided solution. What I'm trying to say here is that the question is rather unclear here. Were they looking for the exception thrown by the bean or by the container?

If it was asking for the exception thrown by the container, the provided solution is obviously correct.

But I could also argue that the bean throws NoSuchEntityException, and that is also correct. Moreover, the question did not state what method was invoked. It could be remove, ejbLoad, ejbStore or any business methods defined in the component interface.

But of course to the client, it could see RemoteException/EJBException or the more specific NoSuchObjectException/NoSuchObjectLocalException.
 
I'm not sure if I approve of this interruption. But this tiny ad checks out:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic