MySQL-代码-Deadlock found when trying to get lock-死锁-提交事务后异步执行
Deadlock found when trying to get lock; try restarting transaction
Upload finalUpload = upload;
String finalObjectId = objectId;
//改成提交事务后异步执行
afterCommitExecutor.execute(new Runnable() {
@Override
public void run() {
Example example = new Example(Upload.class);
example.createCriteria().andEqualTo("objectId", finalObjectId);
uploadMapper.updateByExampleSelective(finalUpload, example);
}
});
正文到此结束