Forum Stats

  • 3,851,719 Users
  • 2,264,016 Discussions
  • 7,904,823 Comments

Discussions

Connect to database

sapna.handyal
sapna.handyal Member Posts: 7
edited Mar 29, 2012 11:04AM in Complex Event Processing
Hi,

I was using a Persistent Store to Record and Playback Events. The documentation for the same includes the steps to configure an Event Store for Oracle CEP Server, for the default (Apache Derby) database.

I need the steps to configure an Event store for Oracle database.

Thanks

Answers

  • Hi,

    You can refer to the server's configuration XSD for help on how to configure a data source. Below is a sample for your convenience:

    -server config.xml
    <data-source>
    <name>eventrepository-test-ds-oracle</name>
    <data-source-params>
    <global-transactions-protocol>
    None
    </global-transactions-protocol>
    </data-source-params>
    <connection-pool-params>
    <initial-capacity>5</initial-capacity>
    <max-capacity>10</max-capacity>
    </connection-pool-params>
    <driver-params>
    <url>jdbc:oracle:thin:@hostname:1521:xe</url>
    <driver-name>oracle.jdbc.OracleDriver</driver-name>
    <properties>
    <element>
    <name>user</name>
    <value>sccot</value>
    </element>
    <element>
    <name>password</name>
    <value>tiger</value>
    </element>
    </properties>
    </driver-params>
    </data-source>
  • Hi Junger,

    Thanks for the sample. Once I do this, I need to specify the RDBMS Event Store Provider by adding an <rdbms-event-store-provider> element to the server's config file. In that case, my code will be (according to the documentation):

    <rdbms-event-store-provider>
    <name>my-rdbms-provider</name>
    <data-source-name>eventrepository-test-ds-oracle</data-source-name>
    </rdbms-event-store-provider>

    According to my understanding, the "my-rdbms-provider" event store is the default event store that comes along with the Berkeley DB. Correct me if I'm wrong.

    Where and how do I define my event store for the Oracle database?

    Thanks
  • Hi,

    Event store is designed for record/playback, you can configure as the following to use the event store:

    <jms-adapter>
    <name>inadapter</name>

    <record-parameters>
    <dataset-name>wlevsqa</dataset-name><!--Note that wlevsqa is a schema name(user) in the DB -->
    <event-type-list>
    <event-type>TradeEvent</event-type>
    </event-type-list>
    <provider-name>test-rdbms-provider</provider-name>
    <batch-size>1</batch-size>
    <batch-time-out>10</batch-time-out>
    </record-parameters>
    </jms-adapter>
  • Hi Junger,

    I am able to store events (of a single event type - totalEventType) in the database. Thanks for the guidance.

    But the events are being stored in a table called "tuplevalue", even though

    <dataset-name>system</dataset-name> and <provider-name>provider</provider-name>. How do I change the table name? Also, Is there a way where I can specify the table in which the events should be stored?


    Along with this, I tried storing multiple event types:

    <record-parameters>
    <dataset-name>system</dataset-name>
    <event-type-list>
    <event-type>totalEventType</event-type>
    <event-type>BAMMessageEvent</event-type>
    </event-type-list>
    <provider-name>provider</provider-name>
    <time-range>
    <start>2012-01-29T05:00:00</start>
    <end>2020-01-20T12:00:00</end>
    </time-range>
    <batch-size>100</batch-size>
    <batch-time-out>10</batch-time-out>
    </record-parameters>

    In this case, events are being recorded, i.e. the EVENT_STORE_SUPPORTED_TYPE table, has the records - totalEventType & BAMMessageEvent.
    But data is getting recorded in the same "tuplevalue" table. (columns with values of totalEventType are "null" and new columns with values of BAMMessageEvent have been added & populated, to the "tuplevalue" table)

    When I do not specify any event type, there is an error for no event type specified.

    How do I deal with this?
This discussion has been closed.