Resolving identifiers for records that share identifiers with existing data

If you are massloading new data into a WebSphere Commerce database that shares identifiers with data that exists in the WebSphere Commerce database, you must include the existing data in the XML file that you want to load. The existing data must appear before the new data in the XML file.

Feature Pack 6 or laterThe massload utility is deprecated for WebSphere Commerce Version 7 Feature Pack 6. The Data Load utility is the recommended command-line loading utility. If you are currently using the mass load utility, you are recommended to switch to the Data Load utility to load your CSV and XML input files into your target database. If your system contains scheduled and automated processes that use massload, it is recommended that you update these processes to use the Data Load utility. Other WebSphere Commerce utilities that use the massload utility, such as the acpload utility, continue to use the massload utility in WebSphere Commerce Version 7 Feature Pack 6. If you have business reasons to continue using the massload utility, you can continue to use this utility. For more information about the Data Load utility, see Overview of the Data Load utility. You can switch to the Data Load utility by using the TableObjectMediator to load your data when no business object mediator exists for the data that you are loading. For more about the TableObjectMediator formation, see Data Load utility table-based mediator and builder.

An example of this situation is adding a language to an existing catalog. For example, you have a master catalog in English and you want to add French information to the catalog.

The idresgen utility generates new identifiers for the new data instead of referencing the existing data for either of the following situations:

  • You do not include the existing data in your XML file.
  • You include the existing data, but the existing data appears after the new data.

By including the existing data before the new data, the idresgen utility is correctly able to resolve the identifiers and relate them to existing identifiers.

Example

A master catalog has English data that is loaded into the database. The English catalog has a shirt with two attributes, color and size. The ATTRIBUTE database table contains the following information:

ATTRIBUTE_ID LANGUAGE_ID ATTRTYPE_ID NAME DESCRIPTION
12090 -1 STRING Color Color
12124 -1 STRING Size Size

To add French data, an XML file with the following contents was created:

<attribute attribute_id="@attribute_id_Size_203010063" name="Size" attrtype_id="STRING" description="Taille" catentry_id="@203010063@-2003" language_id="-2"/>

<attribute attribute_id="@attribute_id_Color_203010063" name="Color" attrtype_id="STRING" description="Couleur" catentry_id="@203010063@-2003" language_id="-2"/>

After you run the idresgen and massload utilities on the XML file, the ATTRIBUTE database table contains the following information:

ATTRIBUTE_ID LANGUAGE_ID ATTRTYPE_ID NAME DESCRIPTION
12090 -1 STRING Color Color
12124 -1 STRING Size Size
14151 -2 STRING Color Couleur
14443 -2 STRING Size Taille

This result is incorrect. The attributes with the same NAME value should also have the same ATTRIBUTE_ID values.

To have the English data and the French data have the correct ATTRIBUTE ID values, the XML file has the following content:

<attribute attribute_id="@attribute_id_Size_203010063" name="Size" attrtype_id="STRING" description="Size" catentry_id="@203010063@-2003" language_id="-1"/>

<attribute attribute_id="@attribute_id_Color_203010063" name="Color" attrtype_id="STRING" description="Color" catentry_id="@203010063@-2003" language_id="-1"/>

<attribute attribute_id="@attribute_id_Size_203010063" name="Size" attrtype_id="STRING" description="Taille" catentry_id="@203010063@-2003" language_id="-2"/>

<attribute attribute_id="@attribute_id_Color_203010063" name="Color" attrtype_id="STRING" description="Couleur" catentry_id="@203010063@-2003" language_id="-2"/>

After you run the idresgen and massload utilities on this XML file, the ATTRIBUTE database table contains the following information:

ATTRIBUTE_ID LANGUAGE_ID ATTRTYPE_ID NAME DESCRIPTION
12090 -1 STRING Color Color
12090 -2 STRING Color Couleur
12124 -1 STRING Size Size
12124 -2 STRING Size Taille