Configuring the ID Resolver involves changing two property files: DB2ConnectionCustomizer.properties and IDResolveKeys.properties. The DB2ConnectionCustomizer.properties file describes how the ID Resolver 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 ID Resolver:
- Follow the step appropriate to your platform:
- Extract the DB2ConnectionCustomizer.properties file in the IdResGen.zip file, located in the following directory:
WC_installdir/lib/loader
WC_installdir\lib\loader
WCDE_installdir\lib\loader
Rename the extracted file and place it in a directory that is in the classpath.
Important: Do not remove or modify the existing DB2ConnectionCustomizer.properties file.
Copy the ISeries_RESWCSID_Customizer.properties file from the following directory:
/QIBM/ProdData/Commerce56/properties
to a directory that is in the classpath , rename the new file but keep the .properties extension. Make the necessary changes to this new file.Important: Do not remove or modify the original ISeries_RESWCSID_Customizer.properties file.
- Extract the DB2ConnectionCustomizer.properties file in the IdResGen.zip file, located in the following directory:
- Increase the Java Virtual Machine (JVM) heap size:
- 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 load 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. For example, if you require to modify the JVM heap size for the ID Resolver, then do the following:
- Open the idresgen utility located in:
WC_installdir/bin/idresgen.sh
WC_installdir\bin\idresgen.cmd
WCDE_installdir\bin\idresgen.cmd
- Change the JVM heap size to 1024 MB as shown in the following example:
%JAVA_HOME%\bin\java -Xms1024M -Xmx1024M -classpath %CP% %idResolver% %* > %log%
- Open the idresgen utility located in:
- 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 load 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. For example, if you require to modify the JVM heap size for the ID Resolver, then do the following:
- Change how the ID Resolver handles database drivers
The following lines in the ID Resolver customizer property file specify the default values for database drivers:
DBVendorName = DB2 DBDriverName = COM.ibm.db2.jdbc.app.DB2Driver DBURL = jdbc:db2:
where:
- Change timestamp masks
- Add or change timestamp masks.
The following default input-timestamp masks are provided:
InputTimeStampFormat.1 = yyyy-DD hh:mm:ss.SSSSSS InputTimeStampFormat.2 = yyyy-MM-dd hh:mm:ss.SSSSSS InputTimeStampFormat.3 = yyyy-DD-hh.mm.ss.SSSSSS InputTimeStampFormat.4 = yyyy-MM-dd-HH.mm.ss.SSSSSS InputTimeStampFormat.5 = yyyy-MM-dd-hh.mm.ss.SSSSSS InputTimeStampFormat.6 = yyyy-MM-dd HH:mm:ss.SSSSSS InputTimeStampFormat.7 = yyyy-DD HH:mm:ss.SSSSSS
Use the next number, for example, the next input-timestamp mask would be InputTimeStampFormat.8.
- Specify the output timestamp format, microsecond mask, and database-specific format by modifying the values of the following attributes:
- TargetTimeStampFormat
- For example, yyyy-MM-dd HH:mm:ss.SSSSSS
- MicroSecondMask
- For example, SSSSSS
- DatabaseSpecificFormat
- For example, YYYY-MM-DD HH24:MI:SS
- Change how the ID Resolver handles storage
- Specify how the ID Resolver handles persistent storage, by setting a value for PersistentStorageType:
- 0
- The ID Resolver operates in the "normal" manner (where the symbol hashmaps exist in memory).
- 1
- Database using the existing connection that the ID Resolver is using (Stores the symbols in the connected database).
- 2
- Database using the new connection (Creates a new connection and stores the symbols in the database).
Note: The previous implementation of persistent storage using JDBM and NDBM is not applicable to this release.
- Specify the number of records stored in memory, by setting a value for MemoryStorageSize:
- 1
- indicates that only one record is kept in memory.
- -1
- All records are kept in memory. In this case, the ID Resolver reverts to its "normal" behavior.
- Specify how the ID Resolver handles persistent storage, by setting a value for PersistentStorageType:
- Add or change timestamp masks.
- Create a foreign relationship using the REFKEYS table
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
- is the foreign (or "child") table name
- FKCOLUMN_NAME
- is the foreign column name
- TABLENAME
- is the primary (or "parent") table name
- Create an entry in the REFKEYS table that describes the required foreign relationship.
Change the IdResolveKeys.properties, or create a new properties file based on the IDResolveKeys.properties file. The file is located in the following directory:
WC_installdir/properties
/QIBM/ProdData/CommerceServer56/properties
WC_installdir\properties
WC_installdirproperties
To change IdResolveKeys.properties, copy it from the directory, save it to the WC_userdir/instances/instance_name/xml directory, then make any necessary changes to the new file.
Note: The above directory is in the classpath used by the idResGen.sh script. The values that you set in this file depend on whether you need to generate identifiers, generate cascaded primary keys, or generate compound keys an example is provided for each type: