• 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
  • Bear Bibeault
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Jj Roberts
  • Tim Holloway
  • Piet Souris
Bartenders:
  • Himai Minh
  • Carey Brown
  • salvin francis

One more confusing question from SUN

 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • 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
  • 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 ]
 
A magnificient life is loaded with tough challenges. En garde tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic