5 Replies Latest reply: Feb 8, 2013 5:55 AM by Rajeev_R RSS

    error while add item to cart

    982246
      hi,

      i get the below error while i add items to cart

      CAUGHT AT:
      CONTAINER:atg.commerce.CommerceException; SOURCE:CONTAINER:atg.service.pipeline.RunProcessException: An exception was thrown from the context of the l
      ink named [updateOrderObject].; SOURCE:CONTAINER:atg.repository.RepositoryException; SOURCE:com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintVi
      olationException: Duplicate entry 'o1160002-1' for key 'PRIMARY'
      at atg.commerce.order.OrderManager.updateOrder(OrderManager.java:2780)

      please help me out.

      --
      sanjeev

      Edited by: sanjeevram on Feb 7, 2013 4:48 AM
        • 1. Re: error while add item to cart
          RMishra
          Duplicate entry 'o1160002-1' for key 'PRIMARY'
          I guess rather than updating old row in db, your operation is trying to add new entry.
          Can you check your customized code?

          -RMishra
          • 2. Re: error while add item to cart
            Onhate
            Are you using prefix and sufix on OrderRepository:order ?
            • 3. Re: error while add item to cart
              Nooruddin Shaik
              It looks you have imported the DB from other environment.
              And missed up with das id generator table.

              There by it is creating the same id's again.
              So update the seed value to higher number in das_id_generator table for order item-descirptor.
              Or add the suffix or prefix.



              Peace
              shaik
              • 4. Re: error while add item to cart
                982246
                hi,

                Thanks for your quick response. i have created the new payment group(Cash on delivery) and removed creditCard from defaultPaymentGroupType, after that i started getting the above error. So i removed new payment group and kept creditCard as defaultPaymentGroupType.

                now i get the below error in my checkout page

                javax.servlet.ServletException: atg.commerce.order.PaymentGroupNotFoundException: PaymentGroup with id pg1990001 is not in container.

                and below error in my server

                15:06:21,296 ERROR [OrderRepository] SQL Statement Failed: [++SQLInsert++]
                INSERT INTO dcspp_order_pg(order_id,sequence_num,payment_groups)
                VALUES(?,?,?)
                -- Parameters --
                p[1] = {pd} o1160002 (java.lang.String)
                p[2] = {pd} 0 (java.lang.Integer)
                p[3] = {pd: paymentGroups} pg1990001 (atg.adapter.gsa.SingleValueGSAId)
                [--SQLInsert--]

                15:06:21,296 ERROR [OrderRepository] Failed to update item: order:o1160002 exception=
                CAUGHT AT:
                CONTAINER:atg.repository.RepositoryException; SOURCE:com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Duplicate entry 'o116
                0002-0' for key 'PRIMARY'
                at atg.adapter.gsa.GSAItemDescriptor.updateItem(GSAItemDescriptor.java:7090)
                at atg.adapter.gsa.ItemTransactionState.updateItemState(ItemTransactionState.java:961)
                • 5. Re: error while add item to cart
                  Rajeev_R
                  javax.servlet.ServletException: atg.commerce.order.PaymentGroupNotFoundException: PaymentGroup with id pg1990001 is not in container.

                  For this issue, check the below link.
                  Not able to add a remaining order amount to a payment group

                  I guess you need to clear all the entries from dcspp_order_pg table to resolve the SQL error.

                  Cheers
                  R