Persistence properties for execution units

You use the persistenceProperties parameter to configure the persistence property of the execution unit (XU).

Ruleset persistence

The configuration of persistence at the execution unit (XU) level relies on two associated properties: persistenceType and persistenceProperties. For example, to set up the XU with file persistence:

  1. Use the persistenceType property to define how rulesets are stored.
    <config-property>
    <config-property-name>persistenceType</config-property-name>
    <config-property-type>java.lang.String</config-property-type>
    <config-property-value>file</config-property-value>
    </config-property>
    
  2. Use the persistenceProperties property to specify the file path.
    <config-property>
    <config-property-name>persistenceProperties</config-property-name>
    <config-property-type>java.lang.String</config-property-type>
    <config-property-value>DIRECTORY=C:/my_ruleset_repo</config-property-value>
    </config-property>
    

To change how rulesets are stored, replace the current value as specified for each of the following persistence modes:

Database persistence in Java™ SE
<config-property-value>
	  DRIVER_CLASS_NAME=org.apache.h2.jdbc.EmbeddedDriver,
	  URL=jdbc:h2:/tmp/data/h2/resdb;create=true,
	  USER=RES,
	  PASSWORD=RES
</config-property-value>

where:

  • DRIVER_CLASS_NAME is a driver implementation class to establish a connection with the database.
  • URL is the JDBC URL to establish a connection with the database.
  • USER is the user name to log in to the database connection.
  • PASSWORD is the password to connect to the database. Use CRYPTED_PASSWORD to pass an encrypted password for database connection.

    See the documentation of the setup Ant task.

Database persistence with a data source
<config-property-value>JNDI_NAME=jdbc/resdatasource</config-property-value>

JNDI_NAME is the JNDI name of the data source.

File persistence
<config-property-value>DIRECTORY=res_data</config-property-value>

res_data is the path to the top directory that contains the rulesets. If the directory path does not start from the root, such as C:/my_directory or /my_directory, it must be understood as a relative path.

Concurrent access
For all persistence types, the CONCURRENT_PERSISTENCE_ACCESS property specifies whether persistence access can be concurrent. Add this property to the configuration of the ruleset provider.
<config-property-value>
	  JNDI_NAME=jdbc/resdatasource,
	  CONCURRENT_PERSISTENCE_ACCESS=false
</config-property-value>

Managed XOM persistence

After you have set the ruleset persistence parameters, you can complete your configuration by setting persistence parameters for the managed Java XOM. XOM persistence relies only on the persistenceProperties property. Set the value as specified for each of the following persistence modes.

Database persistence in Java SE
<config-property-value>
     [...]
     XOM_PERSISTENCE_TYPE=jdbc,
     XOM_PERSISTENCE_DRIVER_CLASS_NAME=org.apache.h2.jdbc.EmbeddedDriver,
     XOM_PERSISTENCE_URL=jdbc:h2:resdb;create=true,
     XOM_PERSISTENCE_USER=RES,
     XOM_PERSISTENCE_PASSWORD=RES
</config-property-value>

where:

  • XOM_PERSISTENCE_DRIVER_CLASS_NAME: is a driver implementation class to establish a connection to the database.
  • XOM_PERSISTENCE_URL is the JDBC URL to establish a connection to the database.
  • XOM_PERSISTENCE_USERis the user name to log in to the database connection.
  • XOM_PERSISTENCE_PASSWORD is the password to connect to the database. Use CRYPTED_PASSWORD to pass an encrypted password for database connection.

    See the documentation of the setup Ant task.

Database persistence with a data source
<config-property-value>
     [...]
     XOM_PERSISTENCE_TYPE=datasource,
     XOM_PERSISTENCE_JNDI_NAME=jdbc/resdatasource
</config-property-value>

XOM_PERSISTENCE_JNDI_NAME is the JNDI name of the data source.

File persistence
<config-property-value>
     [...]
     XOM_PERSISTENCE_TYPE=file
     XOM_PERSISTENCE_DIRECTORY=res_xom
</config-property-value>

res_xom is the path to the top directory that contains the managed XOM. If the directory path does not start from the root, such as C:/my_directory or /my_directory, it must be understood as a relative path.