Hi guys,
I was testing a new payment provider and I have received the next error:
System.Data.DBConcurrencyException: Concurrency violation: the UpdateCommand affected 0 of the expected 1 records. at System.Data.Common.DbDataAdapter.UpdatedRowStatusErrors(RowUpdatedEventArgs rowUpdatedEvent, BatchCommandInfo[] batchCommands, Int32 commandCount) at System.Data.Common.DbDataAdapter.UpdatedRowStatus(RowUpdatedEventArgs rowUpdatedEvent, BatchCommandInfo[] batchCommands, Int32 commandCount) at System.Data.Common.DbDataAdapter.Update(DataRow[] dataRows, DataTableMapping tableMapping) at System.Data.Common.DbDataAdapter.UpdateFromDataTable(DataTable dataTable, DataTableMapping tableMapping) at System.Data.Common.DbDataAdapter.Update(DataSet dataSet, String srcTable) at Dynamicweb.Ecommerce.Orders.OrderRepository.Save(Order order, Int32 extranetUserId) at Dynamicweb.Ecommerce.Orders.OrderService.Save(Order order, Boolean saveOldVersion) at Dynamicweb.Ecommerce.Cart.Frontend.GetContent()
This looks like it is caused by the fact that Instant Payment Notification that is received from the payment provider saves the order at the same time with the save from dynamicweb.
For the save from Instant Payment Notification and the save from Redirect (from checkout handler) I am using a "lock". How can I lock all the order saves from dynamic web?
Thank you,
Adrian