Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes another exception question!!!(HFE  P:556 point 6) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "another exception question!!!(HFE  P:556 point 6)" Watch "another exception question!!!(HFE  P:556 point 6)" New topic
Author

another exception question!!!(HFE P:556 point 6)

pradeep arum
Ranch Hand

Joined: Oct 01, 2003
Posts: 130
A bean wants the client to get an application exception but the bean still wants the transaction to commit.what should the bean do?
before throwing the application exception to the container commit() & then throw.
am i correct?
please help
Pradeep


SCJP1.4,SCBCD
Failure is not when you fall down; its only when you fail to get up again.
Dilli raj
Greenhorn

Joined: Jan 31, 2004
Posts: 24
The client will be able to commit the transaction at any point unless and until the transaction is set to roll back using EJBContext.setRollbackOnly() method before throwing the exception.


SCJP,SCWCD,SCBCD
pradeep arum
Ranch Hand

Joined: Oct 01, 2003
Posts: 130
Thanks DilliRaj,
Do you mean to say, that after an application exception is thrown keep trying from the client until the transaction commits...not calling the setrollbackonly() whatever be the case ...if I want the transaction to commit.
thanks
Pradeep
 
GeeCON Prague 2014
 
subject: another exception question!!!(HFE P:556 point 6)