这是一个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());
没有回滚。