• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

ques from INESystems

 
Giju George
Ranch Hand
Posts: 333
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1. What would happend if an Entity bean has been removed from the database and ejbLoad() is called on a bean instance.

Correct ans given: - javax.ejb.NoSuchEntityException.

I answered javax.ejb.NoSuchObjectException.

Which one is right ???. If the entity is removed, then we get NoSuchEntityException and if the bean instance is removed we get NoSuchObjectException.
Now what does the ques refers to .... !!!

--------------------------------------------------------------------------
Which mechanism can be used to learn if an application exception has resulted in a tx being rolled back ???

Correct ans given :- The bean provider can specify which exceptions will mark a tx for rollback before the exception is throw ..

HOW .....
[ August 06, 2004: Message edited by: Giju George ]
 
Valentin Crettaz
Gold Digger
Sheriff
Posts: 7610
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is no javax.ejb.NoSuchObjectException
NoSuchObjectException is defined in the java.rmi package
 
alzamabar
Ranch Hand
Posts: 379
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Giju George:

Which mechanism can be used to learn if an application exception has resulted in a tx being rolled back ???

Correct ans given :- The bean provider can specify which exceptions will mark a tx for rollback before the exception is throw ..
HOW .....


By invoking setRollbackOnly().

In case of a checked exception, and if the bean provider knows that such exception will cause the transaction to end badly, it's the bean provider's responsibility to invoke setRollbackOnly before rethrowing the exception. (HF p.542)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic