Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

RemoteException

 
Venkatesh Kumar
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi:
One more qt from ejb certificate
Which of the following statements are true when a session bean's client receives a java.rmi.RemoteException? [Check all correct answers]
one of the answers is
The container does not throw the java.rmi.RemoteException if the container performs a transaction rollback.
I think the above answer is wrong bec the container throws RemoteException when it has rolled back a transaction.A container rollsback a transaction when a sys exception arises.But it wraps it as a Remote Exception and throws it to the client.
Please correct me if I am wrong.Thanks in advance for your comments.
 
David O'Brien
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Venkatesh
I wonder if the question is referring to the discusion
in 18.3.1 of the spec where the exception thrown depends
on whether the transaction was started by the client or
the container
- if the client started the transaction (Required, Mandatory, Supports)
the container marks the client's transaction as rolled back
and throws the TransactionRolledback exception
 
David O'Brien
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
(as I was syaing before I accidently presses the Reply button)
- if the container rollbacks back a transaction it started
(Required and RequiresNew) it throws RemoteException
OK so TransactionRolledbackException is a subclass of
RemoteException so (polymorphically) in both cases a
'RemoteException' is returned but there is extra detail in
the TransactionRolledbackException.
Basically I don'u understand the question but perhaps it's not me
 
Vishwa Kumba
Ranch Hand
Posts: 1066
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Venkatesh Kumar:
Which of the following statements are true when a session bean's client receives a java.rmi.RemoteException? [Check all correct answers]
one of the answers is
The container does not throw the java.rmi.RemoteException if the container performs a transaction rollback.
I think the above answer is wrong bec the container throws RemoteException when it has rolled back a transaction.A container rollsback a transaction when a sys exception arises.But it wraps it as a Remote Exception and throws it to the client.

What if the client has created the transaction? The client may receive, TransactionRolledbackException which extends from RemoteException.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic