店铺注册信息提交成功,数据却没有存入到数据库?
来源:4-13 前后端联调验证整体模块功能
慕码人7211748
2020-03-14
老师,我店铺注册信息提交成功,数据却没有存入到数据库,为什么?
SQL语句也没有写错,ShopDao.XML的SQL如下:
控制台也没有报错,Console打印DEBUG信息如下:
2020-03-14 01:49:36.246 [http-nio-8080-exec-4] DEBUG com.imooc.o2o.dao.ShopDao.insertShop - ==> Preparing: INSERT INTO tb_shop(owner_id, area_id, shop_category_id, shop_name, shop_desc, shop_addr, phone, shop_img, priority, create_time, last_edit_time, enable_status, advice) VALUES (?,?,?,?, ?,?,?,?,?, ?,?, ?,?)
2020-03-14 01:49:36.249 [http-nio-8080-exec-4] DEBUG com.imooc.o2o.dao.ShopDao.insertShop - > Parameters: 1(Long), 2(Integer), 2(Long), 咖啡店测试3(String), 咖啡奶奶真好(String), 福州软件园3(String), 13328500221(String), null, null, 2020-03-14 01:49:36.246(Timestamp), 2020-03-14 01:49:36.246(Timestamp), 0(Integer), null
2020-03-14 01:49:36.250 [http-nio-8080-exec-4] DEBUG com.imooc.o2o.dao.ShopDao.insertShop - < Updates: 1
2020-03-14 01:49:36.252 [http-nio-8080-exec-4] DEBUG com.imooc.o2o.utill.ImageUtil - current relativeAddr is:upload\images\item\shop\10\2020031401493624223.jpg
2020-03-14 01:49:36.252 [http-nio-8080-exec-4] DEBUG com.imooc.o2o.utill.ImageUtil - current complete addr is:D:\projectdev\image\upload\images\item\shop\10\2020031401493624223.jpg
2020-03-14 01:49:36.279 [http-nio-8080-exec-4] DEBUG com.imooc.o2o.dao.ShopDao.updateShop - ==> Preparing: update tb_shop SET shop_name=?, shop_desc=?, shop_addr=?, phone=?, last_edit_time=?, enable_status=?, area_id=?, shop_category_id=? where shop_id=?
2020-03-14 01:49:36.281 [http-nio-8080-exec-4] DEBUG com.imooc.o2o.dao.ShopDao.updateShop - > Parameters: 咖啡店测试3(String), 咖啡奶奶真好(String), upload\images\item\shop\10\2020031401493624223.jpg(String), 13328500221(String), 2020-03-14 01:49:36.246(Timestamp), 0(Integer), 2(Integer), 2(Long), 10(Long)
2020-03-14 01:49:36.283 [http-nio-8080-exec-4] DEBUG com.imooc.o2o.dao.ShopDao.updateShop - < Updates: 1
1回答
-
看看你的spring-service.xml 是不是package弄错了,感觉是事务没有自动提交,对比一下视频里面的事务配置
012020-03-15
相似问题