Ignore and update in Impex

We know that we use impex to update any of the existing records

To understand in detail about impex, please go through Impex Overview article

When we are updating multiple records through impex, assume some of the records don’t have corresponding row in the database

Have you ever tried what happens in this case, any guess?

Hybris gets below exception in this case
“no existing item found for update”

Example : 

If we are updating name of 1000 products, obviously we will specify product code as unique for each value
line and provide new name to update.

Assume out of 1000 products, 1 product is not there in DB.


Now this example leads to the above exception and stops further execution

Please have a look at below impex which has invalid product in 3rd value line

  1. $productCatalog=apparelProductCatalog
  2. $catalogVersion=catalogversion(catalog(id[default=$productCatalog]),version[default='Staged'])[unique=true,default=$productCatalog:Staged]
  3. UPDATE Product;code[unique=true];$catalogVersion;name;
  4. ;29531;;"Snowboard Ski Tool Toko Side Edge Angle Pro 88 Grad 1";
  5. ;29532;;"Snowboard Ski Tool Toko Side Edge Tuning Angle Pro 87 Grad 1";
  6. ;invalid_code;;"Snowboard Ski Tool Toko Side Edge Angle Pro 88 Grad 1";
  7. ;29533;;"Snowboard Ski Tool Toko Ergo Multi Guide yellow 1";
$productCatalog=apparelProductCatalog
$catalogVersion=catalogversion(catalog(id[default=$productCatalog]),version[default='Staged'])[unique=true,default=$productCatalog:Staged]
UPDATE Product;code[unique=true];$catalogVersion;name;
;29531;;"Snowboard Ski Tool Toko Side Edge Angle Pro 88 Grad 1";
;29532;;"Snowboard Ski Tool Toko Side Edge Tuning Angle Pro 87 Grad 1";
;invalid_code;;"Snowboard Ski Tool Toko Side Edge Angle Pro 88 Grad 1";
;29533;;"Snowboard Ski Tool Toko Ergo Multi Guide yellow 1";


Solution to above problem is, ignore those records which are not exist in DB and update other records which are valid.

This can be done by adding below line at the top of impex

  1. "#% impex.setDumpingAllowed( true )";
"#% impex.setDumpingAllowed( true )";


So complete impex should be as below

  1. "#% impex.setDumpingAllowed( true )";
  2. $productCatalog=apparelProductCatalog
  3. $catalogVersion=catalogversion(catalog(id[default=$productCatalog]),version[default='Staged'])[unique=true,default=$productCatalog:Staged]
  4. UPDATE Product;code[unique=true];$catalogVersion;name;
  5. ;29531;;"Snowboard Ski Tool Toko Side Edge Angle Pro 88 Grad 1";
  6. ;29532;;"Snowboard Ski Tool Toko Side Edge Tuning Angle Pro 87 Grad 1";
  7. ;invalid_code;;"Snowboard Ski Tool Toko Side Edge Angle Pro 88 Grad 1";
  8. ;29533;;"Snowboard Ski Tool Toko Ergo Multi Guide yellow 1";
"#% impex.setDumpingAllowed( true )";
$productCatalog=apparelProductCatalog
$catalogVersion=catalogversion(catalog(id[default=$productCatalog]),version[default='Staged'])[unique=true,default=$productCatalog:Staged]
UPDATE Product;code[unique=true];$catalogVersion;name;
;29531;;"Snowboard Ski Tool Toko Side Edge Angle Pro 88 Grad 1";
;29532;;"Snowboard Ski Tool Toko Side Edge Tuning Angle Pro 87 Grad 1";
;invalid_code;;"Snowboard Ski Tool Toko Side Edge Angle Pro 88 Grad 1";
;29533;;"Snowboard Ski Tool Toko Ergo Multi Guide yellow 1";


Now rows which contains errors will be skipped and they will be placed in a dump file.

About the Author

Founder of javainsimpleway.com
I love Java and open source technologies and very much passionate about software development.
I like to share my knowledge with others especially on technology 🙂
I have given all the examples as simple as possible to understand for the beginners.
All the code posted on my blog is developed,compiled and tested in my development environment.
If you find any mistakes or bugs, Please drop an email to kb.knowledge.sharing@gmail.com

Connect with me on Facebook for more updates

Share this article on