spring cloud:如何在api网关中实现数据库事务?

时间:2015-12-11 11:12:00

标签: spring spring-cloud

如何在api网关中实现数据库事务?

 @Transactional
 @RequestMapping(value = UserConstants.USERS_PATH, method = RequestMethod.POST)
  public void save(@RequestBody User user) {
    //save two model
    UserEntity ue = userService.save(user.reverseEntity());
    VideoEntity ve = videoService.save(user.getVideo().reverseEntity());
   //service load by eureka + feign
  }

我希望在一次交易中保存两个具有不同服务的模型。

0 个答案:

没有答案