System.Data.SqlServerCe.SqlCeException (0x80004005): A duplicate value cannot be inserted into a unique index. [ Table name = TeaCommerceOrderLinePrice,Constraint name = PKTeaCommerceOrderLinePrice1 ]
at System.Data.SqlServerCe.SqlCeCommand.ProcessResults(Int32 hr)
at System.Data.SqlServerCe.SqlCeCommand.ExecuteCommandText(IntPtr& pCursor, Boolean& isBaseTableCursor)
at System.Data.SqlServerCe.SqlCeCommand.ExecuteCommand(CommandBehavior behavior, String method, ResultSetOptions options)
at System.Data.SqlServerCe.SqlCeCommand.ExecuteNonQuery()
at TeaCommerce.Api.Persistence.Database.Insert(String tableName, String primaryKeyName, Boolean autoIncrement, Object poco)
at TeaCommerce.Api.Persistence.Database.Insert(Object poco)
at TeaCommerce.Api.Persistence.Repositories.OrderRepository.SaveOrderLines(Database database, Guid orderId, OrderLineCollection orderLines, Nullable1 parentOrderLineId)
at TeaCommerce.Api.Persistence.Repositories.OrderRepository.Save(Order order)
at TeaCommerce.Api.Models.Order.Save()
at TeaCommerce.Api.Web.TeaCommerceHelper.AddOrUpdateOrderProperties(Int64 storeId, IDictionary2 properties)
at TeaCommerce.Api.Web.FormPostHandler.AddOrUpdateOrderProperties(Int64 storeId, IDictionary2 formFields, IDictionary2 settings)
at TeaCommerce.Api.Web.FormPostHandler.FormPost()
Ultimately it appears like something is trying to save 2 order lines prices with the same ID into the database. My immediate thought would be that someone might have double submitted the payment form causing it attempt to save the same value twice. If this is the case, maybe adding some JS on the front end to prevent the submit button from being pressed again could help?
The payment provider is QuickPay10.But I can't see any double submission.
This error also occurs in AddOrUpdateOrderProperties form submit.I will double check for any double submit occurs
Just for some more information, the PK_TeaCommerce_OrderLinePrice_1 primary key that it says is in violation is a composite primary key on OrderLineId and CurrencyId, so something is attempting to save multiple values with the same keys.
Teacommerce Form post error
Getting this form post error while submitting a tea commerce HTML API form submit not always but sometimes. Any idea on this and please let me know ?
Log data :
FormPost error --- Form data: -- storeId = "2" -- returnUrl = "/de/shop/cart-content/information/" -- AddOrUpdateOrderProperties = "properties" -- properties = "countryId,cvrNumber,isValidCvrNumber" -- countryId = "DK" -- cvrNumber = "DK33756445" -- isValidCvrNumber = "true"
System.Data.SqlServerCe.SqlCeException (0x80004005): A duplicate value cannot be inserted into a unique index. [ Table name = TeaCommerceOrderLinePrice,Constraint name = PKTeaCommerceOrderLinePrice1 ] at System.Data.SqlServerCe.SqlCeCommand.ProcessResults(Int32 hr) at System.Data.SqlServerCe.SqlCeCommand.ExecuteCommandText(IntPtr& pCursor, Boolean& isBaseTableCursor) at System.Data.SqlServerCe.SqlCeCommand.ExecuteCommand(CommandBehavior behavior, String method, ResultSetOptions options) at System.Data.SqlServerCe.SqlCeCommand.ExecuteNonQuery() at TeaCommerce.Api.Persistence.Database.Insert(String tableName, String primaryKeyName, Boolean autoIncrement, Object poco) at TeaCommerce.Api.Persistence.Database.Insert(Object poco) at TeaCommerce.Api.Persistence.Repositories.OrderRepository.SaveOrderLines(Database database, Guid orderId, OrderLineCollection orderLines, Nullable
1 parentOrderLineId) at TeaCommerce.Api.Persistence.Repositories.OrderRepository.Save(Order order) at TeaCommerce.Api.Models.Order.Save() at TeaCommerce.Api.Web.TeaCommerceHelper.AddOrUpdateOrderProperties(Int64 storeId, IDictionary
2 properties) at TeaCommerce.Api.Web.FormPostHandler.AddOrUpdateOrderProperties(Int64 storeId, IDictionary2 formFields, IDictionary
2 settings) at TeaCommerce.Api.Web.FormPostHandler.FormPost()Hi Vineeth,
What payment provider is this using?
Ultimately it appears like something is trying to save 2 order lines prices with the same ID into the database. My immediate thought would be that someone might have double submitted the payment form causing it attempt to save the same value twice. If this is the case, maybe adding some JS on the front end to prevent the submit button from being pressed again could help?
Hope this helps
Matt
The payment provider is QuickPay10.But I can't see any double submission. This error also occurs in AddOrUpdateOrderProperties form submit.I will double check for any double submit occurs
Thanks
Just for some more information, the
PK_TeaCommerce_OrderLinePrice_1
primary key that it says is in violation is a composite primary key onOrderLineId
andCurrencyId
, so something is attempting to save multiple values with the same keys.is working on a reply...