• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

One more confusing question from SUN

 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Which is true when a remote client receives an exception from an EJB invocation?


A The exception cannot be from the java.rmi package.
B The client might be able to re-invoke the method successfully.
C The exception cannot be a system exception.
D If the client is associated with a transaction, the transaction will have been rolled back.

What exception is he talking about any idea ?
 
Ranch Hand
Posts: 241
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Will Hunt:
Which is true when a remote client receives an exception from an EJB invocation?



I think it is not about one specific exception.

Originally posted by Will Hunt:
A The exception cannot be from the java.rmi package.



False. It CAN be. Every method in home and remote interfaces that a remote client can call MUST declare java.rmi.RemoteException.

Originally posted by Will Hunt:
B The client might be able to re-invoke the method successfully.



True. Let�s suppose that the client called the remove on a stateful session bean that is on a transaction context. The client will receve a big fat RemoveException. But if he called the same method after the transaction ends, the container can remove the bean.


Originally posted by Will Hunt:
C The exception cannot be a system exception.



False. It can be. Despite of the RemoteException be a checked exception( extends Exception but does not extend RunTimeException), it IS considered a System exception. Think of a system exception as a exception that the client cant recover. ie: If a client recece a RemoteException, he can�t know if it was cause by a NullPointerException, ArrayOutOfBoundsException and others RunTimeExceptions.

Originally posted by Will Hunt:
D If the client is associated with a transaction, the transaction will have been rolled back.



FALSE. If the exception throwed was a checked excepting, it will NOT rollback, only with system exceptions. Why ?
Because if it�s checked exception, it�s the bean provider�s resposability to
catch this exception and calls rollback adn than throw it again if necessarity. With RunTimeException, the bean provider can�t treat it so the container will rollback it

I hope it can help ya.

Regards,
[ August 02, 2004: Message edited by: Vinicius Boson ]
 
Lookout! Runaway whale! Hide behind this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic