weijiang1994 / Blogin

A blog system depend on flask.使用flask框架开发的个人博客系统.
https://2dogz.cn
GNU General Public License v3.0
499 stars 97 forks source link

数据库死锁 #25

Closed 199206155416 closed 2 years ago

199206155416 commented 2 years ago

(pymysql.err.OperationalError) (1205, 'Lock wait timeout exceeded; try restarting transaction') image

weijiang1994 commented 2 years ago

哪段代码?

199206155416 commented 2 years ago

哪段代码?

好像是阅读次数修改的时候,两个用户同时看,就会死锁; image

weijiang1994 commented 2 years ago

你把db.session.commit()放到blog.read_times += 1下面去试试看。