Spring @Service 是事务性的吗?

Is Spring @Service transactional?

当我在 spring 服务上并且我想通过 spring 存储库更新几个数据库表时,我是否需要添加 @Transactional 以确保我是事务性和回滚的,或者是已经在那了? 如果是,我是否需要将其添加到 class 级别或方法中?

答案是肯定的,需要单独添加。更多详情请参考:

What is the difference between defining @Transactional on class vs method

Spring - @Transactional - What happens in background?

https://docs.spring.io/spring/docs/4.2.x/spring-framework-reference/html/transaction.html#tx-decl-explained