Configuration of database removal settings

The access specification includes the database query statement definition that you can use for the init or update command. It is not useful to use the same statement for the delete command. It could delete data of the whole segment.

You have to define new database query statement by a new access specification in the connections.xml file. This statement has to provide data that are used as key values of the key-value stores defined in the appropriate data segments.

You have to define a new data source schema in the LookupMgrCustomizing.xml file to provide data of the created access specification. You should define the name of the access specification as value of the DbAccessSpecification attribute of your new DataSource element to refer the data of query results.

You must define the same names for the data source key attributes used for init and update commands as well as for the delete command. You should use the optional DbColumnName attribute in case the database column does not match the key attribute name.

The following figure shows the described cross-references between the customizing file and database configuration settings:


Lookup Manager application - customizing database as input

You must use the DataSourceForValueRemoval attribute in the appropriate segment definition and enter the Name of your new created data source as value if you want to use this data source for the delete command at this segment. The Lookup Manager knows now which data source has to be used for init and update command and witch one is used for delete command.

The following figure shows the described cross-references between the data source and segment settings:


Lookup Manager application - customizing database as input

Before you begin

Configure the access specifications with query statement in the connections.xml file that you can use for init and update commands.

Identify and determine the database columns that you need as keys for the key-value stores.

Configure the access specifications with query statement with the determined key columns in the connections.xml file that you can use for delete commands.

About this task

Configure Lookup Manager’s customizing file using database connections.

Procedure

  1. Open the LookupMgrCustomizing.xml file and the connections.xml file.
  2. Create new DataSource elements for each new access specification if not already existing.

  3. Create the ValueDefinition elements mapping the column names to Name attributess of the ValueDefinition elements if not already existing. If the database column name does not match the name of the ValueDefinition element then use the optional attribute DbColumnName. Remember to use adequate data type mapping from database types to SPL types as described in the reference of the com.ibm.streams.db toolkit.

  4. Copy the values of the name attribute from the access_specification elements in the connections.xml file to the values of the DbAccessSpecification attribute of the appropriate DataSource elements in the LookupMgrCustomizing.xml file in case the the values of the name attribute from the access_specification element is different to the Name attribute of the appropriate DataSource element.

  5. Close the connections.xml file

  6. Create or update the Segment elements with references:

    • for init and update commands: use Name value of DataSource element as value of DataSource attribute of the appropriate Segment element.
    • for delete command: use Name value of DataSource element as value of DataSourceForValueRemoval attribute of the appropriate Segment element.
  7. Implement Stores in the Segment elements according the configuration procedure for usage of database as source.

  8. Save and close the LookupMgrCustomizing.xml file.