• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

rollback for checked exceptions as default

 
srini carry
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


can I specify rollback for any exception checked or unchecked as default , I know by default it is only for unchecked exceptions , in my case even for checked exceptions I want rollback can I do that ?
 
Eduardo Bueno
Ranch Hand
Posts: 155
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, you can. As checked exceptions inherit from Exception class, rollbackFor=Exception.class works perfectly.
 
srini carry
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Eduardo Bueno wrote:Yes, you can. As checked exceptions inherit from Exception class, rollbackFor=Exception.class works perfectly.


that works but I have to specify that on each method can I do that globally or set that as default ?
 
Eduardo Bueno
Ranch Hand
Posts: 155
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can define the methods by name via a TransactionAttributeSource.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic