IBM Support

Lookup table cache usage considerations when using Java API

Troubleshooting


Problem

IBM® InfoSphere® Master Data Management Collaboration Server utilizes an internal lookup table cache to avoid redundant retrieval of lookup table entry information from database server. To optimally use this cache, some considerations need to be taken into account when accessing lookup table entries in custom code using JavaAPI interface

Symptom

When running batch jobs, it is found (for example using Sumall utility) that the same lookup table entry information is retrieved from the database frequently

Cause

JavaAPI functions might have been used to retrieve lookup table entry information, which do not utilize the lookup table cache

Resolving The Problem

In general, MDMCE caches lookup table data, so there is no need to retrieve the data from database.

But when using Java API functions getLookupTableEntries() or getLookupTableEntry(), the lookuptable cache will not be utilized. Instead, the lookup entry details will be queried each time directly from database, which causes extra SQL traffic and slows processing time.

It is recommended to use function getLookupEntryValues() instead to utilize cached lookup table data. This function is available starting with fixpack 10.1.0-FP008 respectively 11.0-FP003.

Code sample:
Context ctx = PIMContextFactory.getCurrentContext();


LookupTable lkp = ctx.getLookupTableManager().getLookupTable(lkpName);
String key = "lkpentrykey";
List<java.lang.Object> lkpvalues = lkp.getLookupEntryValues(key);
try{
  //use get(index) to fetch a specific attribute on a multi column lkp

  //index 0 retrieves first lkp value column
  value = lkpvalues.get(1).toString();
} catch (Exception e){
  value="second attribute not yet saved in Lookuptable";
}


Using getLookupEntryValues() will not cause any additional SQL queries, unless lookup table entries have been saved in the meantime.

Note:
The cache entries for a lookup table will automatically be reloaded from database whenever any entry from that lookuptable is updated or added or deleted.
Therefore do not use lookup tables for frequent updates, especially if the lookup tables contain hundreds or thousands of entries.

Related Information

[{"Product":{"code":"SS2U2U","label":"InfoSphere Master Data Management Collaboration Server"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Component":"--","Platform":[{"code":"PF002","label":"AIX"},{"code":"PF016","label":"Linux"},{"code":"PF027","label":"Solaris"}],"Version":"10.0;10.1;11.0;11.3;11.4","Edition":"","Line of Business":{"code":"","label":""}}]

Document Information

Modified date:
16 June 2018

UID

swg21691023