赞
踩
一、死锁问题背景
在收据批量打印时,由于采用异步并发触发打印,同时触发打印(九千多数据 每隔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 建议
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。