Can a caller be notified when there is a rollback in the called method?
In my controller I would like to be able to return a message that indicates that an error produced a rollback.
For example:
Code:
someService.insertRowInDB ( someDomainObject ) ; // this method annotated with @Transactional
if (thereWasARollback) {
return rollback ; // view name
} else {
return success ; // view name
}
I know I could detect the exception that triggers a rollback and set a return value that can be used to determine if there was a rollback. I would rather have Spring tell me.
Thanks,
bils