Browse Source

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

yuj 7 years ago
parent
commit
e8cf425e08

+ 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) {