Setting the compiled archives cache

When working with ruleset archives for the decision engine (.dsar files), you can use the compiled archives cache to limit the bytecode generation to the first execution of a ruleset only. The execution unit (XU) generates the bytecode when a ruleset is executed, and stores it into a file-based cache for reuse.

Before you begin

  • The compiled archives cache applies only to ruleset archives that are created from a rule project with Decision engine as Rule Engine property.
  • In Java™ SE, the compiled archives cache feature requires to have the POI third-party library installed in the class path.
  • If Java security is enabled, you must set the appropriate read and write file permissions on the directory of the compiled archives cache.

About this task

A ruleset archive (.dsar file) created from a rule project with Decision engine as Rule Engine property, does not always contain the bytecode. Decision Center never includes the bytecode when generating a .dsar file. The bytecode generation cannot be done at deployment time either because the XOM is not always available. If you do not use the compiled archives cache, the XU must generate the bytecode before each ruleset execution, which can impact performance. Enable the compiled archives cache to limit the bytecode generation to the first execution of a ruleset only. This way, the bytecode is generated only once, even if the ruleset is unloaded from the memory, or if the XU is restarted. On subsequent executions, the generated bytecode is read from the file-based cache. To achieve the best performance, use a high speed file storage.

The compiled archives cache must not be shared between multiple XU instances running on the same or on a different Java virtual machine (JVM).

By default, the compiled archives cache is not enabled.

  • On Jakarta EE, you can configure the compiled archives cache in the administration console of your application server, through the compiledArchivesCacheProperties property.
  • On Java SE, you must change the ra.xml file, through the compiledArchivesCacheProperties XU configuration property.
  • Use the maxSize parameter to set the maximum number of compiled archives in the cache.
  • Use the path parameter to set the directory of the compiled archives cache.

The compiled archives cache is enabled if the path parameter is set to a valid directory.

Important:
  • After any engine update, make sure that you clean out the entire directory of the compiled archives cache before restarting the XU.
  • Rulesets deployed in earlier product versions might need to be redeployed.

Procedure

  1. On Jakarta EE, modify the compiled archives cache settings by using the administration console of your application server, then restart the application server.
  2. On Java SE, modify the connector deployment descriptor to change the compiledArchivesCacheProperties XU configuration property as follows:
    [...]
        <config-property>
           <config-property-name>compiledArchivesCacheProperties</config-property-name>
           <config-property-type>java.lang.String</config-property-type>
           <config-property-value>maxSize=20,path=/var/cache/xu/ca_cache</config-property-value>
         </config-property>
    [...]