Closed 199206155416 closed 2 years ago
(pymysql.err.OperationalError) (1205, 'Lock wait timeout exceeded; try restarting transaction')
哪段代码?
好像是阅读次数修改的时候,两个用户同时看,就会死锁;
你把db.session.commit()放到blog.read_times += 1下面去试试看。
db.session.commit()
blog.read_times += 1
(pymysql.err.OperationalError) (1205, 'Lock wait timeout exceeded; try restarting transaction')