代码改变世界

随笔档案-2020年06月

多线程异步操作导致异步线程获取不到主线程的request信息

2020-06-28 17:47 by 话猫, 2096 阅读, 收藏, 编辑
摘要: org.springframework.web.context.request.RequestContextHolderorg.springframework.web.context.request.RequestAttributesorg.springframework.web.context.r 阅读全文

使用mybatis更新数据时 时间字段的值自动更新

2020-06-13 10:25 by 话猫, 4773 阅读, 收藏, 编辑
摘要: 1.debug打印出来执行的sql语句发现并没有修改时间的字段,最后发现是设计表时勾选了根据当前时间戳更新。。。。。 去掉该字段的根据当前时间戳更新语句: alter table tableName change filedName fieldName timestamp NOT NULL DEFA 阅读全文

mysql死锁com.mysql.cj.jdbc.exception.MYSQLTransactionRollbackException Deadlock found when trying to get lock;try restarting transaction

2020-06-06 17:47 by 话猫, 5975 阅读, 收藏, 编辑
摘要: 1.生产环境出现以下报错 该错误发生在update操作中,该表并未建立索引,也就是只有InnoDB默认的主键索引,发生错误的程序是for循环中update。 什么情况下会出现Deadlock found when trying to get lock? https://dev.mysql.com/d 阅读全文
点击右上角即可分享
微信分享提示