当前位置:   article > 正文

pgsql批量死锁_call getnextexception to see other errors in the b

call getnextexception to see other errors in the batch.

jdbc批量更新时死锁.
java.sql.BatchUpdateException: Batch entry 910 UPDATESQL语句 was aborted:ERROR:deadlock detected
详细: Process 157988 waites for ShareLock on transaction 7944777; blocked by process 157400.
Process 157400 waites for ShareLock on transaction 7944775; blocked by process 157988.
建议:see server log for query details.
在位置:while updatingq tuple(1149,7)
in relation “table_name” Call getNextException to see other errors in batch.


java.sql.BatchUpdateException: Batch entry 910 UPDATESQL语句 was aborted:ERROR:deadlock detected
详细: Process 159216 waites for ShareLock on transaction 7944738; blocked by process 157989.

Process 157989 waites for ShareLock on transaction 7944739; blocked by process 159216.

在位置:while updating tuple(299,19) in relation “table_name” Call getNextException to see errors in the batch.

死锁了(deadlock detected)!
检查代码未见死锁代码,提示也指向数据库死锁.
推测是锁表导致的,单个updateById不会锁边,jdbc的批量更新.所以可能未执行索引.

加锁后,果然死锁消失.

记一次锁表导致的死锁异常.

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/我家小花儿/article/detail/511836
推荐阅读
相关标签
  

闽ICP备14008679号