Win a copy of OCP Oracle Certified Professional Java SE 11 Developer Practice Tests this week in the OCP 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
  • Ron McLeod
  • Tim Cooke
Sheriffs:
  • Devaka Cooray
  • paul wheaton
  • Mark Herschberg
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Frits Walraven
  • Jj Roberts
Bartenders:
  • Carey Brown
  • salvin francis
  • Piet Souris

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 ]
 
No matter how many women are assigned to the project, a pregnancy takes nine months. Much longer than this tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic