//发布网店记录:
@Transactional
public int SaveShopRec(Shops shop) throws Exception {
try {
//1).保存网店记录产生自增长ID:
int res1 = shopDao.Master_SaveShopRec(shop);
//2).保存(网店)附属信息:
Shopsub shopsub = new Shopsub();
shopsub.setShopId(shop.getId());
shopsub.setSid(shop.getSid());
int res2 = shopDao.Master_SaveShopSub(shopsub);
if(res1 > 0 && res2 > 0) {
logger.info("***[spcenter]发布网店信息,记录成功,ID:"+shop.getId());
return 1;
}
}catch(Exception e) {
logger.info("***[spcenter]保存网店记录,Err:"+e.toString());
throw new RuntimeException();
}
return 0;
}
ssm架构中的事务回滚
最新推荐文章于 2021-02-11 11:14:45 发布