Developer forum

Forum » Development » System.Data.DBConcurrencyException: Concurrency violation in Payment provider

System.Data.DBConcurrencyException: Concurrency violation in Payment provider

Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

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


Replies

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi guys,

Anybody has any idea here?

Are we the only ones getting this type of error?

Thank you,
Adrian

 
Jeppe Eriksson Agger Dynamicweb Employee
Jeppe Eriksson Agger
Reply

Hi Adrian,

We've recently fixed an issue for orders where there could be multiple order instances in play. That could potentially lead to this problem. If possible, upgrade to Dynamicweb 9.8.4 or 9.8.5 (released today) and try again.

- Jeppe

 

You must be logged in to post in the forum