交易不会使用Spring回滚

时间:2018-06-20 10:53:02

标签: spring spring-transactions rollback

这是一个Spring Boot项目,其中的控制器如下所示:

@Scope(value = "session")
@Component(value = "controller")
@ELBeanName(value = "controller")
@Join(path = "/list", to = "/check/check-list.jsf")
public class controller {
  @Autowired
  private CheckService checkService;
  public String save() {
    checkService.save(checkVO);
}

Service实现类如下:

    @Override
    @Transactional(propagation = Propagation.REQUIRED)
    public void save(CheckVO checkVO) {
        LOGGER.info("saving check information {}", Calendar.getInstance().getTime());
        checkRepository.save(checkVO.getcheck());
        checkImagesRepository.save(checkVO.getImages());
    }

问题是呼叫checkImagesRepository.save(checkVO.getImages());失败,并且checkRepository.save(checkVO.getcheck());没有回滚。

0 个答案:

没有答案