• 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
  • Ron McLeod
  • Paul Clapham
  • Rob Spoor
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Junilu Lacar
  • Tim Cooke
Saloon Keepers:
  • Tim Holloway
  • Piet Souris
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Frits Walraven
  • Himai Minh

ques from INESystems

 
Ranch Hand
Posts: 333
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Author & Gold Digger
Posts: 7617
6
IntelliJ IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There is no javax.ejb.NoSuchObjectException
NoSuchObjectException is defined in the java.rmi package
 
Ranch Hand
Posts: 379
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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)
 
Grow your own food... or this tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic