Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想在业务服务级别处理和回滚异常,但是当我在 jdbctemplete 中使用 datasourcetransacitonmanager 时,它只是处理数据库异常,您有什么建议吗?多重管理或?合并事务管理器?
查看服务方法上的 @Transactional 注释。这应该使服务中的任何内容都可以事务处理,如果一个失败,它会全部回滚。
http://docs.spring.io/spring-framework/docs/2.5.x/api/org/springframework/transaction/annotation/Transactional.html