aspose file tools
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes HFEJB Question Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Reply Bookmark "HFEJB Question" Watch "HFEJB Question" New topic
Author

HFEJB Question

Gowher Naik
Ranch Hand

Joined: Feb 07, 2005
Posts: 643
HFEJB Pno-556
I am not able to solve below given points-:

A bean realizes it cannot commit a transaction,but it does not want the client to get an exception.what can the bean do?

A bean wants the client to get an application exception but the bean still wants the transaction to commit.what should bean do?

Please Help
Thanks
Amol Nayak
Ranch Hand

Joined: Oct 26, 2006
Posts: 218
A bean realizes it cannot commit a transaction,but it does not want the client to get an exception.what can the bean do?

A bean wants the client to get an application exception but the bean still wants the transaction to commit.what should bean do?


I can think of this,

If the bean throws system exception, transaction will rollback and an exception will be thrown to client. We dont want this.

The only way is to call setRollbackOnly() and mark the transaction to rollback.


Regarding the second one,
If our method has declared the application exception in the signature
and throws it, the container will not rollback the transaction and
throw the exception to client.

What do you think? Is it right?
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: HFEJB Question
 
Similar Threads
In page 556 of HFEJB what's the answer for Point no.6?
One more Exception question
another exception question!!!(HFE P:556 point 6)
Pg 556 Exception scenarios answers.
Some doubts about exception handling