Running the DatabaseCache Project

You can run the process in the DatabaseCache project to see how to query and store tuples in a space.

Prerequisites

Ensure that you have imported the DatabaseCache project to TIBCO Business Studio as described in Importing Sample Projects.

Procedure

  1. In the Project Explorer view, expand the DatabaseCache project.
  2. Expand the Module Descriptors resource and double-click Module Properties. Provide the following values for the associated module properties:
    • The value of the BaseDir property is TIBCO_HOME/bw/palettes/activespaces/version_number/samples/DatabaseCache/data.
    • The value of the InputFileName property is TIBCO_HOME/bw/palettes/activespaces/version_number/samples/DatabaseCache/input.txt.
  3. Click Processes > databasecache > Process.bwp.
  4. From the menu, click Run > Run Configurations.
  5. In the Run Configurations dialog, expand BusinessWorks Application and click BWApplication.
  6. In the right panel, click Deselect All and select the check box next to DatabaseCache.application. Then click Apply.
  7. Click Run to run the process.
  8. Click the icon to stop the process.

Result

  • If a tuple in Myspace or the database.data file matches the input ID, a message similar to the following example is written to the output file:
    • 2015-Jan-15 16:56:05 Found user - ID: 001, Name: Charlie, Email: Charlie@google.com, Age: 22
  • If a tuple in Myspace or the database.data file does not match the input ID, a message similar to the following example is written to the output file:
    • 2015-Jan-15 16:57:59 Can't find user - ID: 009

The database.data and output file are located in the TIBCO_HOME/bw/palettes/activespaces/version_number/samples/DatabaseCache/data directory.