你顶楼给出的例子中间并没有运用到声明性事务(declarative transaction),我觉得也许你有必要搞清楚它和在业务代码中直接硬编码的事务有何区别再回头想一想你的论题。
基于8个网页-相关网页
Spring声明性事务为那些实现了(可选)事务特性的仓库提供了支持。
Spring declarative transactional support for repositories that implement the (optional) transactional feature.
假设Bean后面的每个数据库操作都是同等重要的,那么声明性事务(就像EJB中的那些)就是一个简化事务管理的强有力的方法。
Declarative transactions, such as those in EJB's are [a] sledge hammer approach to simplifying transaction management, assuming that every database operation behind the bean is of equal importance.
应用推荐