SQL Server deadlock problem: Transaction (Process ID x) was deadlocked with another process lock | communication buffer resources on and has been chosen as the deadlock victim. Rerun the transaction.

Setting the while at The error occurred ### the Parameters
### SQL: Update ERP_SCjh_zzc_pl the SET IF_TONGBU = 1 the WHERE (IF_TONGBU IF_TONGBU IS = 0 or null) and djno and djlb = =??
### in the Cause: com.microsoft.sqlserver.jdbc .SQLServerException: transaction (process ID 191) was deadlocked with another process lock | communication buffer resources on, and has been chosen as the deadlock victim. Rerun the transaction.
; SQL []; Transaction (Process ID 191) was deadlocked with another process lock | communication buffer resources on, and has been chosen as the deadlock victim. Rerun the transaction. ; Nested exception is com.microsoft.sqlserver.jdbc.SQLServerException: Transaction (Process ID 191) was deadlocked with another process lock | communication buffer resources on, and has been chosen as the deadlock victim. Rerun the transaction.
[2019-08-24 17: 26: 52,077] [qtp1891502635-26] [ERROR] [ExceptionController.java:26] ==> Exception Msg:

 

 

This article was written feel good, read three times, not quite understand, recorded:
https://www.cnblogs.com/happyhippy/archive/2008/11/14/1333922.html

Solution:

    1. SQLServer SQL automatically selected as a deadlock victim;
    2. Access objects in the same order;
    3. SELECT statement plus with (onlock) prompt;
    4. Lower isolation level
    5. Before the addition of the SQL SET LOCK_TIMEOUT timeout_period, when the lock request timeout_period exceeds the set time, it will terminate the current execution of SQL
    6. Use row versioning-based isolation levels
    7. Use bound connections

Lock Related: https: //www.cnblogs.com/wynn0123/p/4633776.html

 

Guess you like

Origin www.cnblogs.com/gzhbk/p/11407070.html