Group: Forum Members
Last Active: Mon 9 Sep 2019
Posts: 27,
Visits: 117
|
Hi,
I'm looking for some help with a database related problem which has just started happening for no obvious reason that I can see.
It centres around the 'Product Promotions', and only on some of the items on discount, not all of them. The problem occurs if a customer selects more than one of an item that is on discount ( i.e. two or more of the same product ), then when they checkout the site simply loops back to the checkout page rather than progressing to the payment gateway.
I've looked in the error logs and they seem to be indicating a duplicate key violation. I've been running these kind of promotions for years, with no problems, so I'm struggling to see what might have gone wrong?
Any ideas or advice would be most welcome.
This is the error log:
----------------------------------------------------------------------------- >> OrdersBLL.Add ----------------------------------------------------------------------------- >> System.Data.SqlClient.SqlException >> 02/02/2017 11:49:49 >> Version:2.7001 >> CUSTOM MESSAGE: Database Error: duplicate-key violation. >> NUMBER:2627 >> MESSAGE: Violation of PRIMARY KEY constraint 'PK_tblKartrisOrdersPromotions'. Cannot insert duplicate key in object 'dbo.tblKartrisOrdersPromotions'. The duplicate key value is (33634, 118). The statement has been terminated. >> STACK: 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) at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean asyncWrite) at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean asyncWrite) at System.Data.SqlClient.SqlCommand.ExecuteNonQuery() at OrdersBLL.Add(Int32 C_ID, String strUserEmailAddress, String strUserPassword, Address BillingAddress, Address ShippingAddress, Boolean blnSameShippingAsBilling, BasketBLL BasketObject, ArrayList BasketArray, String strOrderDetails, String strGatewayName, Int32 intLanguageID, Int32 intCurrencyID, Int32 intGatewayCurrencyID, Boolean blnOrderEmails, String strShippingMethod, Double numGatewayTotalPrice, String strEUVATNumber, String strPromotionDescription, String strPurchaseOrderNo, String strComments) ==================================================
|