| Author |
Clarification need for Appliation Exception
|
Jeya Uma
Greenhorn
Joined: Jan 11, 2009
Posts: 3
|
|
Hi,
Please clarify me on the below
can @ApplicationException apply to both checked and unchecked application exception?
If it is applicabel to only unchecked application exception, how can we set rollabck as true for checked application exception?
Thanks
Uma
|
 |
Amandeep Singh
Ranch Hand
Joined: Jul 17, 2008
Posts: 836
|
|
Do like this
@ApplicationException(rollback=true)
|
SCJP 1.4, SCWCD 5, SCBCD 5, OCPJWSD 5,SCEA-1, Started Assignment Part 2
My blog- http://rkydesigns.blogspot.com
|
 |
Chaminda Amarasinghe
Ranch Hand
Joined: May 17, 2006
Posts: 402
|
|
Yes you can,
But understand this.
all checked exceptions (which are not system) are application exceptions implicitly (that means you no need any annotation or dd. but rollback is false. If you want to rollback you have to define explicitly using annotation or in DD).
but an unchecked exception (which are not system) is not an app exception implicitly as checked. to define an unchecked exception as app excetpion you must have to annotate or declare in DD.
|
 |
Jeya Uma
Greenhorn
Joined: Jan 11, 2009
Posts: 3
|
|
|
Thanks for your Clarification
|
 |
Joe Harry
Ranch Hand
Joined: Sep 26, 2006
Posts: 8795
|
|
|
Anything that is not a System exception (or anything not a subclass of RuntimeException or RemoteException) is an ApplicationException. ApplicationExceptions by default do not rollback a transaction and you have to tell it explicitly as the above post says.
|
SCJP 1.4, SCWCD 1.4 - Hints for you, SCBCD Hints - Demnachst, SCDJWS - Auch Demnachst
Did a rm -R / to find out that I lost my entire Linux installation!
|
 |
 |
|
|
subject: Clarification need for Appliation Exception
|
|
|