Transactional annotation to rollback for every checked exception - with AspectJ
问题 I would like to use @Transactional annotation ( org.springframework.transaction.annotation ) for transactions management. I need the rollback to occur for every exception (not just unchecked exceptions), so I use: @Transactional (rollbackFor = Exception.class) I use AspectJ mode, and it's working fine. The problem is, I don't want the developer to have to add the rollbackFor attribute every time. I found this answer, that suggests to extend the @Transactional annotation, like so: @Target(