请稍等 ...
×

采纳答案成功!

向帮助你的同学说点啥吧!感谢那些助人为乐的人

店铺注册信息提交成功,数据却没有存入到数据库?

老师,我店铺注册信息提交成功,数据却没有存入到数据库,为什么?

图片描述
图片描述

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弄错了,感觉是事务没有自动提交,对比一下视频里面的事务配置

0 回复 有任何疑惑可以回复我~
  • 提问者 慕码人7211748 #1
    非常感谢!spring-service.xml 没有错,我再检查下
    回复 有任何疑惑可以回复我~ 2020-03-15 03:24:34
问题已解决,确定采纳
还有疑问,暂不采纳
意见反馈 帮助中心 APP下载
官方微信