1.SpringBootApplication启动类上加注解@SpringBootApplication2.在需要事务回滚的方法名上加注解@Transactional(rollbackFor = Exception.class)