Skip to main content

ATG Order update - InvalidVersionException and ConcurrentUpdateException

ATG repository item descriptor can have the version property. The atg.adapter.gsa.ItemTransactionState holds this version information. For example consider the Order item-descriptor. It has the version property defined against the table dcspp_order. Means, the dcspp_order table has the column version which defines which version of order is currently in the DB. Each order update flow will update this column.

 <property name="version" display-name-resource="version" data-type="int" queryable="true" readable="true" column-name="version" hidden="false" category-resource="categoryInfo" expert="true" required="false" cache-mode="inherit" writable="true">
    <attribute name="uiwritable" value="false"/>
    <attribute name="propertySortPriority" value="30"/>
  </property>


-------------------------------

During the OrderManager.updateOrder() call, validation is done to compare the vesion of the Order object to the one in repository and the exception atg.commerce.order.InvalidVersionException is thrown.
 
2012-09-08 11:38:24,213 99015942 ERROR [nucleusNamespace.atg.commerce.order.OrderManager] (TP-Processor77:) InvalidVersionException: Unable to update order for :6226680554
2012-09-08 11:38:24,213 99015942 ERROR [nucleusNamespace.atg.commerce.order.OrderManager] (TP-Processor77:)
atg.commerce.order.InvalidVersionException: This order (6226680554) is out of date. Changes have been made to the order and the operation should be resubmitted. Order version 136, Repository item version 138.
    at atg.commerce.order.OrderManager.updateOrder(OrderManager.java:2557)


--------------------------------   


During the order update @ GSAItemDescriptor, atg.repository.ConcurrentUpdateException is thrown if no row got updated based on the "where" condition. If the table is having a version property, the where condition includes the version also. And in case of Order, this exception may occurs if the version in the DB not matches with the one in order object.
   
Caused by: atg.repository.ConcurrentUpdateException: no rows updated oldVersion=3 for item=order:6284190656 in GSATransaction=atg.adapter.gsa.GSATransaction@1ccdb05    thread=TP-Processor86 transaction=TransactionImpl:XidImpl[FormatId=257, BranchQual=, localId=4931830]
    at atg.adapter.gsa.GSAItemDescriptor.updateItem(GSAItemDescriptor.java:6070)
    at atg.adapter.gsa.GSARepository.updateItem(GSARepository.java:949)
    at atg.commerce.order.processor.ProcSaveOrderObject.runProcess(ProcSaveOrderObject.java:180)
    at atg.service.pipeline.PipelineManager.runProcess(PipelineManager.java:453)
    at atg.commerce.order.OrderManager.updateOrder(OrderManager.java:2586)


-------------------------------

Comments

  1. This comment has been removed by the author.

    ReplyDelete
  2. How to avoid InvalidVersionException and ConcurrentUpdateException ? Does one need to wrap all update, insert order statements in begin and end transaction code ?

    ReplyDelete
  3. InvalidVersionException and ConcurrentUpdateException will occur due to bad coding/ bad server configuration / clustering.

    ReplyDelete

Post a Comment

Popular posts from this blog

Tax Credit Statement ( Form 26AS )

Read more about Tax filing @  http://tips4ufromsony.blogspot.com/2011/07/income-tax-process-and-e-filing.html  . Form 26AS is a consolidated tax statement issued under Rule 31 AB of Income Tax Rules to PAN holders. This statement, with respect to a financial year, will include details of: Tax deducted at source (TDS). Tax collected at source (TCS). Advance tax/self assessment tax/regular assessment tax etc., deposited in the bank by the taxpayers (PAN holders). Paid refund received during the financial year. Form 26AS will be prepared only with respect to Financial Year 05-06 onwards. To view the Form26AS , log-in to https://incometaxindiaefiling.gov.in and click on ‘View Tax Credit Statement (From 26AS)’  in ‘My Account’. Read more about Form 26AS  @ http://www.incometaxindia.gov.in/26ASTaxCreditStatement.asp http://www.tin-nsdl.com/form26as.asp

ATG Search - how to configure multiple language search

Here I am going to explain the steps involved in configuring the multi-language ATG Search if your site support multiple language. I have given the different steps in indexing and search flows. Indexing flow : You could configure different search projects for different locales to support parallel search indexing for each locale. You could setup search environment for the search projects so that the indexing host is different for the two projects. Configure the LocaleVariantProducer @ ProductCatalogOutputConfig to specify the locale for the new language. Include the language dictionaries you need in Search Admin on the Search Projects which can be used for indexing and searching in multiple languages. Specify the locales @ \atg\search\config\LanguageDimensionService so that you could configure the search configurations for each language. When you create the search configuration tree, specify the "Contents vary by" as Language, to configure the search configurations li...

Good features of Eclipse3.5 (Eclipse Galileo) JDT

This blog will list down the new features of Eclipse Galileo JDT. I will write another blog regarding the features of Eclipse Helios and Eclipse Indigo. Read about Eclipse Helios features @  http://tips4ufromsony.blogspot.com/2011/11/good-features-of-eclipse-36-eclipse.html ========================================================== 1. Toggle Breadcrumb —> Will list the name of the file and the method name with respect to your cursor position , on the top of the Eclipse IDE. From here you can go to other methods, other classes in same package , …. Screen shot of Toggle Breadcrumb: ========================================================== 2. From the method call , you can either go to declaration or to implementation Screen shot of implementation call: ========================================================== 3. Advanced Open Type –> You can restrict the open type to a selected Working set only. Screen shot of Advanced Open Type: ==========...

Search Facets - how to create a new search facets in ATG Search

A Facet is a search refinement element that corresponds to a property of a commerce item type. ATG supports the search result refinement using the Faceted Search concept. Read more about facted search @  http://en.wikipedia.org/wiki/Faceted_search . Facet can either be ranges or specific values. Each facet is stored in the RefinementRepository as a separate refineElement repository item. Facets are divided into Global and Local facets. Global facets apply to all the categories and local facets only to the category in which they are created. For example Price/Brand can be considered as the facets that are common for all skus and New Release/Coming Soon can be considered as the facets that are specific to Physical Media products like Vidoe/DVD/Blue-ray/Books. We can use the ATG BCC - Merchandising UI to create facets. The Faceting Property depends on the meta-properties defined in the \atg\commerce\search\product-catalog-output-config.xml ( the def...