Developer forum

Forum » Development » Deadlock at Checkout step

Deadlock at Checkout step

Zayar Minn Dynamicweb Employee
Zayar Minn
Reply
Hi,
 
I am facing deadlock problem when entering into Checkout step. It is not happening for all Orders (average 1250 transactions per day in office hours). But 3 to 9 Orders per day.
Here below is some info and logs. Is there any way to avoid? Is it possible by EcomNumbers?
 
Application 9.8.6
 
-- Log Info --
2022-01-05 10:26:45.181: UPDATE [EcomOrders] SET [OrderID] = @p0 WHERE [OrderID] = @p1;  UPDATE [EcomOrderLines] SET [OrderLineOrderID] = @p0 WHERE [OrderLineOrderID] = @p1;. System.Data.SqlClient.SqlException (0x80131904): Transaction (Process ID 64) was deadlocked on lock | communication buffer resources with another process and has been chosen as the deadlock victim. Rerun the transaction.
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString, Boolean isInternal, Boolean forDescribeParameterEncryption, Boolean shouldCacheForAlwaysEncrypted)
at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, Boolean inRetry, SqlDataReader ds, Boolean describeParameterEncryptionRequest)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry)
at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry)
at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
at Dynamicweb.Data.Database.ExecuteNonQuery(IDbCommand command) ClientConnectionId:d5d66b8d-f927-4b59-b915-18c36f3a7e68 Error Number:1205,State:52,Class:13
 
 
Description: Unexpected exception GetContent() with the message: Transaction (Process ID 64) was deadlocked on lock | communication buffer resources with another process and has been chosen as the deadlock victim. Rerun the transaction.
 
2022-01-05 10:26:45.196: Unexpected exception GetContent() with the message: Transaction (Process ID 64) was deadlocked on lock | communication buffer resources with another process and has been chosen as the deadlock victim. Rerun the transaction.
System.Data.SqlClient.SqlException (0x80131904): Transaction (Process ID 64) was deadlocked on lock | communication buffer resources with another process and has been chosen as the deadlock victim. Rerun the transaction.
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString, Boolean isInternal, Boolean forDescribeParameterEncryption, Boolean shouldCacheForAlwaysEncrypted)
at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, Boolean inRetry, SqlDataReader ds, Boolean describeParameterEncryptionRequest)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry)
at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry)
at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
at Dynamicweb.Data.Database.ExecuteNonQuery(IDbCommand command)
at Dynamicweb.Data.Database.ExecuteNonQuery(CommandBuilder commandBuilder, IDbConnection connection, IDbTransaction transaction, Int32 commandTimeout)
at Dynamicweb.Data.Database.ExecuteNonQuery(CommandBuilder commandBuilder, IDbConnection connection, Boolean useTransaction, Int32 commandTimeout)
at Dynamicweb.Data.Database.ExecuteNonQuery(CommandBuilder commandBuilder, Boolean useTransaction, Int32 commandTimeout)
at Dynamicweb.Ecommerce.Orders.OrderRepository.UpdateOrderId(String oldOrderId, String newOrderId)
at Dynamicweb.Ecommerce.Orders.OrderService.UpdateOrderId(Order order, String newOrderId)
at Dynamicweb.Ecommerce.Cart.Frontend.RenderCheckoutStep(Order order, Int32 stepIndex)
at Dynamicweb.Ecommerce.Cart.Frontend.GetContent() ClientConnectionId:d5d66b8d-f927-4b59-b915-18c36f3a7e68 Error Number:1205,State:52,Class:13
 
 
-- Column Header --
EventClass | TextData | ApplicationName | Duration | ClientProcessId | SPID | Start | End | BinaryData
-- Lock Timeout x5 (on 10:26:41.920 and 10:26:42.040 >> duration 0) --
Lock:Timeout 1:642304 .Net SqlClient Data Provider 0 13128 54 2022-01-05 10:26:41.920 2022-01-05 10:26:41.920 0X00CD09000100000000000000050006
Lock:Timeout 1:642304 .Net SqlClient Data Provider 0 13128 64 2022-01-05 10:26:42.040 2022-01-05 10:26:42.040 0X00CD09000100000000000000050006
Lock:Timeout 1:1104375 .Net SqlClient Data Provider 0 13128 64 2022-01-05 10:26:42.040 2022-01-05 10:26:42.040 0XF7D910000100000000000000050006
Lock:Timeout 1:2087695 .Net SqlClient Data Provider 0 13128 64 2022-01-05 10:26:42.040 2022-01-05 10:26:42.040 0X0FDB1F000100000000000000050006
Lock:Timeout 1:2433191 .Net SqlClient Data Provider 0 13128 54 2022-01-05 10:26:42.040 2022-01-05 10:26:42.040 0XA72025000100000000000000050006
 
 
-- Column Header --
EventClass | TextData | SPID | Start | BinaryData
-- Deadlock --
Lock:Deadlock Chain Deadlock Chain SPID = 64 1:2087695 5 2022-01-05 10:26:45.693 0X0FDB1F000100000000000000050006
Lock:Deadlock Chain Deadlock Chain SPID = 64 1:1104375 5 2022-01-05 10:26:45.693 0XF7D910000100000000000000050006
Lock:Deadlock Chain Deadlock Chain SPID = 64 1:642304 5 2022-01-05 10:26:45.693 0X00CD09000100000000000000050006
Lock:Deadlock Chain Deadlock Chain SPID = 54 1:2433191 5 2022-01-05 10:26:45.693 0XA72025000100000000000000050006
Lock:Deadlock Chain Parallel query worker thread was involved in a deadlock 5 2022-01-05 10:26:45.693
 
 
-- Column Header --
EventClass | TextData | ApplicationName | Duration | ClientProcessId | SPID | Start | End | BinaryData
-- (on 10:26:42.037 to 10:26:45.693 >> 3656 duration)
Lock:Deadlock 1:2087695 .Net SqlClient Data Provider 3656 13128 64 2022-01-05 10:26:42.037 2022-01-05 10:26:45.693 0X0FDB1F000100000000000000050006
 
 
Regards,
Zayar MIinn
 

 


Replies

 
Nicolai Pedersen
Reply
This post has been marked as an answer

Hi Zayar

This can happen in some setups - i.e. if the integration is importing to ecomorders and ecomorderlines table (rare) or if 2 processes otherwise manipulates the same object (i.e. using some async js that calls the cart pages) or when under heavy load.

We have made a fix in 9.10.11 that greatly reduces the number of locks on the ecomorders and ecomorderlines tables that should solve this issue.

BR Nicolai

Votes for this answer: 1

 

You must be logged in to post in the forum