Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Clarification need for Appliation Exception

 
Jeya Uma
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 850
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do like this

@ApplicationException(rollback=true)
 
Chaminda Amarasinghe
Ranch Hand
Posts: 411
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your Clarification
 
Joe Harry
Ranch Hand
Posts: 10106
3
Eclipse IDE Mac PPC Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic