| Author |
Cannot insert duplicate key row in object 'BasketGroup' with unique index 'BasketGroup
|
|
| Quinn Wilson 2005-03-14, 5:54 pm |
| Stack Trace: System.Web.HttpUnhandledException: Exception of type
System.Web.HttpUnhandledException was thrown. --->
Microsoft.CommerceServer.Runtime.Orders.CommerceOrderSystemException:
Failed to save basket state to underlying stores. --->
Microsoft.CommerceServer.Runtime.CommerceException: SaveAsBasket
Failed. ---> System.Runtime.InteropServices.COMException (0x80040E2F):
Cannot insert duplicate key row in object 'BasketGroup' with unique
index 'BasketGroup_ind'.[23000]
The statement has been terminated.[01000]
The above error occurs frequently in my event log, I cannot duplicate
it, but I need to fix.
My site is based on the Retail2002 site; the exception is thrown in
TxContext.vb at the Cart.Save() call in the code below.
Can anyone shed any light? I'm concerned b/c it seems that this error
is occuring more and more frequently lately.
I'm running CS2K2 SP3 (w/o FP1)
--------------------------------------------------------------------------------
Dim currencyCode As String
'--- Retrieve site's currency code
'
currencyCode =
CType(CommerceContext.Current.Resources(CommerceResources. AppDefaultConfig)(AppDefaultConfigProper
ties.BaseCurrencyCode),
String)
'--- Create New OrderForm and set BillingCurrency code at Cart level
'
_CartOrderForm = New OrderForm(DefaultOrderForm)
Cart.Item(TxCartProperties.BillingCurrency) = currencyCode
'--- Add Order Form and set BillingCurrency code
'
Cart.OrderForms.Add(_CartOrderForm)
_CartOrderForm.Item(TxOrderFormProperties.BillingCurrency) =
currencyCode
Cart.Save()
--------------------------------------------------------------------------------
| |
| Quinn Wilson 2005-03-17, 5:53 pm |
| Microsoft? Can you help me?
This problem is not going away.
I am using a MS project as a base, and the error seems to be coming
from the CS2K2 Runtime. I am at the end of my diagnostic abilities w/o
some help.
| |
| Vinod Kumar[MSFT] 2005-03-21, 5:59 pm |
| Did you try running the Sql trace to see what duplicate key is being inserted in the BasketGroup table?
-Vinod
This posting is provided "AS IS" with no warranties, and confers no rights.
You assume all risk for your use. © 2002 Microsoft Corporation. All rights
reserved.
--------------------
From: "Quinn Wilson" <Quinn.Wilson@nygard.com>
Newsgroups: microsoft.public.commerceserver.general
Subject: Cannot insert duplicate key row in object 'BasketGroup' with unique index 'BasketGroup_ind'.
Date: 14 Mar 2005 06:48:21 -0800
Organization: http://groups.google.com
Lines: 45
Message-ID: <1110811701.604291.92650@f14g2000cwb.googlegroups.com>
NNTP-Posting-Host: 64.4.94.11
Mime-Version: 1.0
Content-Type: text/plain; charset="iso-8859-1"
X-Trace: posting.google.com 1110811706 9178 127.0.0.1 (14 Mar 2005 14:48:26 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Mon, 14 Mar 2005 14:48:26 +0000 (UTC)
User-Agent: G2/0.2
Complaints-To: groups-abuse@google.com
Injection-Info: f14g2000cwb.googlegroups.com; posting-host=64.4.94.11;
posting- account=bDdG_wwAAABX6L5dQ2AaXX0FWcNLzSrU
Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed00.sul.t-online.de!t-online.de!news.glorb.com!postnews.google.com!f14g2000cwb.googlegroups.com!not-
for-mail
Xref: TK2MSFTNGXA02.phx.gbl microsoft.public.commerceserver.general:15759
X-Tomcat-NG: microsoft.public.commerceserver.general
Stack Trace: System.Web.HttpUnhandledException: Exception of type
System.Web.HttpUnhandledException was thrown. --->
Microsoft.CommerceServer.Runtime.Orders.CommerceOrderSystemException:
Failed to save basket state to underlying stores. --->
Microsoft.CommerceServer.Runtime.CommerceException: SaveAsBasket
Failed. ---> System.Runtime.InteropServices.COMException (0x80040E2F):
Cannot insert duplicate key row in object 'BasketGroup' with unique
index 'BasketGroup_ind'.[23000]
The statement has been terminated.[01000]
The above error occurs frequently in my event log, I cannot duplicate
it, but I need to fix.
My site is based on the Retail2002 site; the exception is thrown in
TxContext.vb at the Cart.Save() call in the code below.
Can anyone shed any light? I'm concerned b/c it seems that this error
is occuring more and more frequently lately.
I'm running CS2K2 SP3 (w/o FP1)
--------------------------------------------------------------------------------
Dim currencyCode As String
'--- Retrieve site's currency code
'
currencyCode =
CType(CommerceContext.Current.Resources(CommerceResources. AppDefaultConfig)(AppDefaultConfigProper
ties.BaseCurrencyCode),
String)
'--- Create New OrderForm and set BillingCurrency code at Cart level
'
_CartOrderForm = New OrderForm(DefaultOrderForm)
Cart.Item(TxCartProperties.BillingCurrency) = currencyCode
'--- Add Order Form and set BillingCurrency code
'
Cart.OrderForms.Add(_CartOrderForm)
_CartOrderForm.Item(TxOrderFormProperties.BillingCurrency) =
currencyCode
Cart.Save()
--------------------------------------------------------------------------------
| |
| Quinn Wilson 2005-03-21, 5:59 pm |
|
Vinod Kumar[MSFT] wrote:
> Did you try running the Sql trace to see what duplicate key is being
inserted in the BasketGroup table?
>
> -Vinod
>
QCW321 No. I cannot duplicate the error in the live environment nor
any of my testing environments.
| |
| Marijan Domijan 2005-03-29, 6:18 pm |
| Try checking in IIS log to see if there are concurrent requests from the
same user when error happens.
If there are, then you might have the same problem I did. Problem occurs
when requests from same user are not serialized and user double clicks on
some button. In that case Commerce Server may end up working with same
basket in 2 threads, and saving both baskets to database using INSERT. It
will do INSERT only if basket dit not exist in database before.
"Quinn Wilson" <Quinn.Wilson@nygard.com> wrote in message
news:1111442177.425632.141680@l41g2000cwc.googlegroups.com...
>
> Vinod Kumar[MSFT] wrote:
> inserted in the BasketGroup table?
>
> QCW321 No. I cannot duplicate the error in the live environment nor
> any of my testing environments.
>
|
|
|
|