Configure the idresgen utility

Configure the idresgen utility involves changing two property files: DB2ConnectionCustomizer.properties and IDResolveKeys.properties. The DB2ConnectionCustomizer.properties file describes how the idresgen utility handles timestamps, storage, and database drivers. The IDResolveKeys.properties file specifies which columns of a primary entry should be used as lookups for tables that require the identifier of a primary row.

To configure the idresgen utility:

  1. Increase the Java Virtual Machine (JVM) heap size for the idresgen utility.

    By default, the maximum amount of memory allocated to the JVM heap is 64 MB. If this is not increased, the JVM can eventually run out of memory during the ID resolving process. The maximum amount of memory allocated to the Java heap can be varied by using the JVM -mx option in the Java command. If you are loading files that are more than 500 MB, then increase the JVM heap size to 512 MB or 1024 MB.

    To modify the JVM heap size for the idresgen utility:

    1. Open the idresgen utility command in a text editor. The idresgen utility command is the following file:

    2. Change the JVM heap size to 1024 MB by specifying the -Xms and -Xmx options of the Java command:

      • If the -Xms and -Xmx parameters are already specified in the file, change the values to the heap size that you want. Ensure that you update all occurrences of -Xms and -Xmx.

      • If the -Xms and -Xmx parameters are not specified in the file, change all occurrences of %JAVA_HOME%\bin\java in the utility command file to %JAVA_HOME%\bin\java -Xms1024M -Xmx1024M.

    3. Save your changes.

  2. (Optional) Change the directory for the idresgen utility error log. By default, the idresgen utility writes the error log to the following directory:

    To change the location of the idresgen utility error log:

    1. Open the following idresgen utility file in a text editor:

    2. Change error report location setting:

      • If the -Dcom.ibm.wcm.ErrorReporterDir parameter is already specified in the file, change the directory to the new location for the idresgen utility error log. Ensure that you update all occurrences of -Dcom.ibm.wcm.ErrorReporterDir.

      • If the -Dcom.ibm.wcm.ErrorReporterDir parameter is not specified in the file, change all occurrences of %JAVA_HOME%\bin\java %PM_ARGS% in the utility command file to %JAVA_HOME%\bin\java %PM_ARGS% -Dcom.ibm.wcm.ErrorReporterDir=error_log_directory.

      The directory you specify must exist. The idresgen utility does not create the directory for you. If the specified directory does not exist, no error log file is produced. Additionally, if you have configured message logging for the idresgen utility, a DirNotExististException message is logged in the message log

    3. Save your changes.

  3. Update the IdResolveKeys.properties file to define how keys should be generated as the data is resolved. The file is located in the following directory:

    The values that you set in the IdResolveKeys.properties file depend on whether generate identifiers, generate cascaded primary keys, or generate compound keys.

    An example is provided for each type:

  4. Change how the idresgen utility handled cursors by editing the DB2ConnectionCustomizer.properties file in WC_installdir/lib/loader/IdResGen.zip

    This step is not required when using the idresgen utility provided with WebSphere Commerce Developer.

    The following lines in the ID Resolver customizer property file specify how the idresgen utility handles cursors:

     SpecifyCursorHold = yes
     CursorHold = false
    

    where:

    Parameter Parameter setting
    SpecifyCursorHold Specifies whether to hold the cursor across transactions. The default value is SpecifyCursorHold = no
    CursorHold If this property is set to true (CusorHold = true), cursors are not closed when a transaction is committed or rolled back. All resources acquired during the unit of work are held, but locks on specific rows and objects implicitly acquired during the unit of work are released.

  5. (Optional) By default, the idresgen utility uses the Oracle thick JDBC client. To change the idresgen utility to use the Oracle thin JDBC client:

    1. Open WC_installdir/properties/OracleConnectionCustomizer.properties in a text editor.

    2. Locate the following text:

      ConnectStringID = jdbc:oracle:oci8:@

    3. Change the text to match the following text:

      ConnectStringID = jdbc:oracle:thin:@

    4. Save your changes.

  6. Create an entry in the REFKEYS table that describes the required foreign relationship.

    The REFKEYS table is created to represent a foreign relationship between tables that does not already exist in the database. Generally, the database schema describes the foreign relationship by creating a foreign-key declaration that links a column of a table to another table. If the database schema does not have a foreign relationship defined and the identifiers have to be resolved as a foreign key, then do the following:

    Create a REFKEYS table as shown in the following example DDL:

      CREATE TABLE "REFKEYS" (
                   "FKTABLE_NAME"    CHAR(18)   NOT NULL ,
                   "FKCOLUMN_NAME"   CHAR(18)   NOT NULL ,
                   "TABLENAME"       CHAR(18)   NOT NULL 
      );
    

    Where:

    FKTABLE_NAME

    The foreign (or "child") table name

    FKCOLUMN_NAME

    The foreign column name

    TABLENAME

    The primary (or "parent") table name

Related concepts

Related tasks

Related reference