| Author |
rollback for checked exceptions as default
|
srini carry
Ranch Hand
Joined: Nov 30, 2007
Posts: 83
|
|
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
Joined: Jun 04, 2009
Posts: 154
|
|
|
Yes, you can. As checked exceptions inherit from Exception class, rollbackFor=Exception.class works perfectly.
|
 |
srini carry
Ranch Hand
Joined: Nov 30, 2007
Posts: 83
|
|
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
Joined: Jun 04, 2009
Posts: 154
|
|
|
You can define the methods by name via a TransactionAttributeSource.
|
 |
 |
|
|
subject: rollback for checked exceptions as default
|
|
|