Your Question
在写一些测试用例的时候,为了方便跑完测试后删除测试数据,会使用事务,测试完成后再rollback。导致出现
Error: Deadlock found when trying to get lock; try restarting transaction
这个错误出现频率不高,但也是个问题,想问问gormv2关于测试用例 ,枷锁能否同时加成功,这个问题应该如何避免?谢谢!
The document you expected this should be explained
Expected answer
Comment From: li-jin-gou
需要排查为什么会出现死锁,这个错误是数据库返回的,不是Gorm哈