浏览代码

更新在售信息时添加事务。

yuj 7 年之前
父节点
当前提交
e8cf425e08
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      src/main/java/com/uas/platform/b2c/prod/commodity/service/impl/GoodsServiceImpl.java

+ 2 - 1
src/main/java/com/uas/platform/b2c/prod/commodity/service/impl/GoodsServiceImpl.java

@@ -132,6 +132,7 @@ import org.springframework.jdbc.core.JdbcTemplate;
 import org.springframework.jdbc.core.RowCallbackHandler;
 import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate;
 import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Propagation;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.ui.ModelMap;
 import org.springframework.util.StringUtils;
@@ -3749,7 +3750,7 @@ public class GoodsServiceImpl implements GoodsService {
      * @param product 产品信息
      * @return
      */
-    @Transactional
+    @Transactional(propagation = Propagation.REQUIRED, rollbackFor = RuntimeException.class)
     @Override
     public void updateGoodsByProduct(Product product) {
         if (product == null) {