当前位置:   article > 正文

postgresql 并发访问_postgresql 并发update下导致的死锁问题

postgresql while rechecking updated tup

一、死锁问题背景

在收据批量打印时,由于采用异步并发触发打印,同时触发打印(九千多数据 每隔50ms触发一次),导致了并发执行引起在接口更新打印次数时postgresql发生死锁问题,

具体报错如下:

1 ### The error occurred whilesetting parameters2 ### SQL: update t_sc_receipt set print_num = coalesce(print_num,0) + 1 ,print_ts=?

3 ### Cause: org.postgresql.util.PSQLException: ERROR: deadlock detected4 详细:Process 19540 waits for ShareLockon transaction 12520113; blocked by process 19539.5 Process 19539 waits for ShareLock on transaction 12520112; blocked by process 19540.6 建议:See server log forquery details.7 在位置:while rechecking updated tuple (329,3) in relation "t_sc_receipt"

8 ; SQL []; ERROR: deadlock detected9 详细:Process 19540 waits for ShareLock on transaction 12520113; blocked by process 19539.10 Process 19539 waits for ShareLock on transaction 12520112; blocked by process 19540.11 建议:See server log forquery details.12 在位置:while rechecking updated tuple (329,3) in relation "t_sc_receipt"; nested exception is org.postgresql.util.PSQLException: ERROR: deadlock detected13 详细:Process 19540 waits for ShareLock on transaction 12520113; blocked by process 19539.14 Process 19539 waits for ShareLock on transaction 12520112; blocked by process 19540.15 建议

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

闽ICP备14008679号