5 Replies Latest reply: Jul 20, 2011 10:59 PM by Nooruddin Shaik RSS

    CONCURRENT UPDATE EXCEPTION

    Joshua
      Hi All,

      We are getting a CUE only for a particular user, i.e when this user logs in , it loads his pending orders and then when we try to checkout the order we get the below error. This is happening only for a particular user account, when we enabled debug on OrderRepository we found that during handleMoveToOrderCommit operation, some how an update query is fired(before processOrder chain is executed) which increments the version number - this query cannot be seen in the log(query where the version number became 578). Thus , when processOrder chain is executed it throws Concurrent Update Exception.

      Any inputs regarding this is highly appreciated.



      UPDATE dcspp_order
      SET version=?,state=?,submitted_date=?
      WHERE order_id=? AND version=?
      -- Parameters --
      p[1] = {pd: version} 578 (java.lang.Integer)
      p[2] = {pd: state} SUBMITTED (java.lang.String)
      p[3] = {pd: submittedDate} 2011-07-19 23:23:55.744 (java.sql.Timestamp)
      p[4] = {pd} o9820006 (java.lang.String)
      p[5] = {pd} 577 (java.lang.Integer)
      [--SQLUpdate--]

      2011-07-19 23:24:02,609 INFO [nucleusNamespace.atg.commerce.order.OrderRepository] DEBUG updateItem(order:o9820006) (CONCURRENT UPDATE EXCEPTION: no rows found for version=577)
      2011-07-19 23:24:02,609 INFO [nucleusNamespace.atg.commerce.order.OrderRepository] DEBUG removeCurrentProperties(order:o9820006)
      2011-07-19 23:24:02,610 INFO [nucleusNamespace.atg.commerce.order.OrderRepository] DEBUG setPropertyValue(order:o9820006.submittedDate,12/31/1969 18:00:00)
      2011-07-19 23:24:02,611 ERROR [nucleusNamespace.atg.commerce.order.ShoppingCartModifier]
      java.lang.RuntimeException: CONTAINER:atg.repository.RepositoryException; SOURCE:org.jboss.util.NestedSQLException: Transaction is not active: tx=TransactionImple < ac, BasicAction: -53e3c8d2:c32f:4e26092b:3b367 status: ActionStatus.ABORT_ONLY >; - nested throwable: (javax.resource.ResourceException: Transaction is not active: tx=TransactionImple < ac, BasicAction: -53e3c8d2:c32f:4e26092b:3b367 status: ActionStatus.ABORT_ONLY >)
      at atg.adapter.gsa.GSAItemDescriptor.loadProperty(GSAItemDescriptor.java:5464)
      at atg.adapter.gsa.GSAItem.getPersistentPropertyValue(GSAItem.java:1078)
      at atg.adapter.gsa.GSAItem.getPropertyValue(GSAItem.java:971)
      at atg.adapter.gsa.GSAItem.getItemTransactionState(GSAItem.java:2088)
      at atg.adapter.gsa.GSAItem.getItemTransactionState(GSAItem.java:1968)
      at atg.adapter.gsa.GSAItem.getItemTransactionState(GSAItem.java:1954)
      at atg.adapter.gsa.GSAItem.getItemTransactionStateUnchecked(GSAItem.java:2143)
      at atg.adapter.gsa.GSAItem.setPropertyValue(GSAItem.java:1332)
      at atg.adapter.gsa.GSAPropertyDescriptor.setPropertyValue(GSAPropertyDescriptor.java:407)
      at atg.adapter.gsa.DatePropertyDescriptor.setPropertyValue(DatePropertyDescriptor.java:149)
      at atg.repository.RepositoryItemImpl.setPropertyValue(RepositoryItemImpl.java:223)
      at atg.adapter.gsa.GSAItem.setPropertyValue(GSAItem.java:1308)

      Edited by: user4180179 on Jul 19, 2011 10:19 PM

      Edited by: user4180179 on Jul 19, 2011 11:12 PM
        • 1. Re: CONCURRENT UPDATE EXCEPTION
          Nooruddin Shaik
          Look at this post which explains different scenarios CUE can occur.
          https://community.atg.com/message/1294

          Peace
          Shaik
          • 2. Re: CONCURRENT UPDATE EXCEPTION
            Joshua
            Yes, I had a look at it. In fact we are getting this error running on a single instance with simple caching mode. The strange part is that it happens only for a particular user profile. Setting item-cache-timeout to session timeout as mentioned in the link would not help in our case since we are getting the error in a normal flow which hardly takes 5 min.

            After debgging OrderRepository, I can see that somehow the dcspp_order table gets updated when we click "Purchase"(and this query cannot be seen in the log - we can see all the other queries in the log) BEFORE the processOrder pipeline is executed from handleMoveToCommitOrder.
            • 3. Re: CONCURRENT UPDATE EXCEPTION
              Nooruddin Shaik
              Very strange! If you are running on one instance then OOTB you should not see this issue.
              But can happen in this case if your ProfileAdapterRepository or any other repository using order repository tables.
              And also see if they are refering OrderReposiory items.

              Peace
              Shaik
              • 4. Re: CONCURRENT UPDATE EXCEPTION
                Joshua
                Is there a way to trouble shoot this at the DB level? Is there any tables that I can look into that would provide more information? I have the order number but I am not able to see any tables that I can get meaningful information from to find the root cause of this issue.
                • 5. Re: CONCURRENT UPDATE EXCEPTION
                  Nooruddin Shaik
                  You can try writing some triggers at dcspp_order table and see if that helps.

                  Peace
                  Shaik