Copyright © TIBCO Software Inc. All Rights Reserved


Chapter 4 Backing Store Tutorial : Configure the TIBCO BusinessEvents Studio Project

Configure the TIBCO BusinessEvents Studio Project
In this task you modify the Fraud Detection Cache project to support a backing store, and learn a little about the settings available to configure the backing store behavior at runtime. Except for excluding entities from the backing store, these configuration options can be configured before or after setting up the backing store and can be changed after the backing store is in place.
Learning Points
Can I exclude entities from the backing store?  Yes. You can configure various settings at the individual entity type level. To exclude entities, use the CDD Cluster tab > Object Management > Domain Objects > Overrides feature. Uncheck an entity override’s Has Backing Store checkbox to exclude it from the backing store. See Excluding Entities from the Backing Store in TIBCO BusinessEvents Administration for more details (including another way to exclude entities, using their Mode setting).
If later you want to include any excluded entities, you must change the setting and update the backing store setup as explained in Updating an Existing Backing Store Schema in TIBCO BusinessEvents Administration
Which database connection pool strategy to use, JDBC or Oracle?  If you use Oracle Database, you have the option of using either the TIBCO BusinessEvents internal pooling implementation, or Oracle Database’s implementation. Various pooling settings are interpreted differently depending on what strategy you choose. You can also not enforce pools, in which case all connection pool settings are ignored.
Which database write strategy to use, cache-aside or write-behind?  You can choose how data is written to the backing store. With cache-aside (the default), writes to the database and cache are made simultaneously. With write behind (used if you uncheck the Cache Aside check box), writes to the cache are done first, and then the cache manager writes to the database. To understand these choices in more detail, see Post RTC Options — Cache Aside and Write Behind in TIBCO BusinessEvents Administration.
What is preloading?  When you use a backing store, you can preload entity data from the backing store to the cache before the system begins processing events. If you don’t preload entities, they are fetched from the backing store as required at runtime.
Why preload handles?  Entity object handles are stored in a special cache that can be preloaded or not depending on storage and performance needs. It might be more efficient in some cases to preload handles and not objects, for example. See The Role of the Object Table in TIBCO BusinessEvents Architect’s Guide for more details.
Preloading commonly used objects can improve performance after startup. By default, no preloading is done. You can preload all objects or objects of selected entity types, as desired. See Configuring a Cache OM Cluster — Cluster Tab in TIBCO BusinessEvents Administration for the procedure.
More Information
In TIBCO BusinessEvents Administration, see the following:
In TIBCO BusinessEvents Developer’s Guide see JDBC Connection.
Task B Rename the Fraud Detection Cache Project and Change Port
1.
2.
In Studio Explorer, right click the project name and select Refactor > Rename. In the New Name field, type FraudDetectionStore and click Preview. You can preview the effect of this change, then click OK.
3.
Open the HTTPConnection resource that’s in the SharedResources folder and change the port to 8209.
The provided FraudDetectionStore example project ships with this port, and its readme.html points to it as well (see Dependency Between Readme File and Project — Port Number for more details).
4.
Task C Add a JDBC Connection Resource
In this task, you add a JDBC Connection resource to your project and configure it to connect to the backing store database. (You can do this before creating the database if the necessary details are known.)
Details below assume you will connect to a local instance of Oracle 10g Express Edition database. Adapt the instructions as needed for your database product.
1.
In TIBCO BusinessEvents Studio, open your project (if it is not already open), right-click the SharedResources folder and select New > Other > TIBCO Shared Resources > JDBC Connection (or select the folder and press Ctrl-N as in earlier tutorials).
2.
You see the JDBC Connection resource editor.
The globe icons to the right of the settings in this resource type indicate that you can use global variables in the field value. To learn more about this topic, see Working with Global Variables in TIBCO BusinessEvents Developer’s Guide.
3.
Optionally, enter a description such as JDBC Connection for the backing store tutorial.
 
4.
In the JDBC Driver field, you see two boxes. Select the appropriate driver for your database from the selection box on the right. The tutorial example uses oracle.jdbc.OracleDriver (thin). The driver name appears in the box on the left, and a Database URL format appears in the Database URL field just below. For the Oracle thin driver, the format is:
jdbc:oracle:thin:@<host>:<port#>:<db_instancename>
5.
jdbc:oracle:thin:@localhost:1521:XE
Where 1521 is the default port, and XE is the default instance name for Oracle Database 10G Express. (The default instance name for Oracle Database 10g is ORCL.)
6.
In the User Name and Password fields, enter the username and password of the database user you will create (in Task E, Run the Initialize Database Script as the DBA or System User). Type the name BE_USER and password BE_USER. (The password field does not display the text.)
7.
Task D Rename and Configure the CDD, then Build the EAR
Begin by renaming the CDD from the Cache OM Tutorial, and add a few configuration details for backing store functionality: click a checkbox to enable backing store functionality, and select the JDBC Connection resource you want to use. Of course, more options are available for different needs.
1.
In Studio Explorer, right click the fdcache.cdd resource and select Refactor > Rename. In the New Name field, type fdstore and click Preview. You can preview the effect of this change, then click OK.
2.
Open the newly renamed fdstore CDD file in the resource editor.
3.
Cluster Clashes  If you have clashes with other clusters running on your machine, use a different cluster name, discovery URL and listen URL from the other cluster or clusters. See Chapter 3, Cache OM Tutorial > Task C, Add and Configure a CDD > step 4, on page 58 for details.
4.
Select Cluster tab > Object Management > Backing Store and check the Enabled checkbox.
5.
In the Database Type field, select oracle or sqlserver, depending on the type of database you are using. Oracle is the default so if you are using Oracle you don’t have to do anything.
6.
Select Cluster > Object Management > Backing Store > Connection on the left and in the URI field, select the JDBC Connection shared resource you configured for the backing store (see Task C, Add a JDBC Connection Resource).
You can optionally check that the rest of the CDD configuration is correct. Refer to Task R, Add and Configure a CDD, in Chapter 4, Backing Store Tutorial.
7.
Select Domain Objects > Default on the left.
The Domain Objects area is where you configure how objects are managed. You can set defaults, and you can override them for specific entities.
Projects that were migrated from an earlier version have domain object override entries for all entity types by default. This is because entity metadata properties that were configured in entity resources are configured as CDD domain object override entries in version 5.0. You can delete these entries if not needed or just leave them. For newly created projects, create overrides as needed.
On the right, ensure that Mode is set to Cache Only (the default for the Cache CDD template).
Check the Preload Entities and Preload Handles checkboxes.
Preloading is not necessary for the tutorial to function, but it is a commonly used feature. See section introduction for more details.
8.
If there are overrides, check each entry in turn, and make sure that the Mode is set to Cache Only, and that the Has Backing Store checkbox is checked.
9.
10.
Change the Name to FraudDetectionStore
In the File Location setting, specify a location from which you can access the EAR when you run the setup utility and when you start the engine.
At the end of the location string, change the file name to fdstore.ear. The FraudDetectionStore example ships with this value: BE_HOME/examples/standard/FraudDetectionStore/fdstore.ear.
If you need a refresher on building the EAR file, see Task S, Build the EAR File.
Summary and Next Steps
Now you are ready to run the scripts that prepare the backing store’s database schema.

Copyright © TIBCO Software Inc. All Rights Reserved