Forum Stats

  • 3,855,374 Users
  • 2,264,500 Discussions
  • 7,905,979 Comments

Discussions

Save Stream of Data in Oracle Database

900697
900697 Member Posts: 50
edited Mar 30, 2012 1:39PM in Complex Event Processing
Hi,

I want to save processed event records in Oracle relational database.

How it can be done?

Is JDBC Cartridge can be used to insert records to databse? If yes, how can be done?

Or is it required to implement custom event store if database is other than derby, can't we use existing event store?
How to implement custom event store using API, where to download this API?

Thanks,
Sri

Edited by: 897694 on Mar 29, 2012 12:22 AM
Tagged:

Answers

  • I don't think JDBC cartridge is suitable for persist events into DB. It's easy to do it with record/playback. Below is the configuration that you can use:

    --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>
  • 900697
    900697 Member Posts: 50
    Hi,


    Thanks for your input.

    We have tried that and result is storing in table that is created by CEP itself.
    I want to know how to assign existing table as a destination for event store, if existing table has as same schema.

    Thanks,
    Sri
  • 722711
    722711 Member Posts: 91
    As of the current implementation, you cannot use a different table name to store the events.
  • 900697
    900697 Member Posts: 50
    Thank you.

    I have one more question.

    How 2 events are saving in database.
    If i used one event type under <event-type-list> its working fine, saves data in db.
    And then I have added with 2 events, no save of data.

    I removed first event and kept second event, it added new column to the same table and saves details.

    Why is that? Am i missing any configuration?

    Thanks,
    Sri
  • 722711
    722711 Member Posts: 91
    When you specify multiple event types, it is expected to save the different event types in different tables. Could you post the details of the event types (names and properties)?

    Manju.
  • 900697
    900697 Member Posts: 50
    Hi,

    Below are the events:

    <wlevs:event-type type-name="EventType1">
    <wlevs:properties>
    <wlevs:property name="Uid" type="char"/>
    <wlevs:property name="arrivalTime" type="timestamp"/>
    <wlevs:property name="endLogUid" type="char"/>
    <wlevs:property name="startLogUid" type="char"/>
    </wlevs:properties>
    </wlevs:event-type>

    <wlevs:event-type type-name="EventType2">
    <wlevs:properties>
    <wlevs:property name="message" type="char"/>
    </wlevs:properties>
    </wlevs:event-type>

    Thanks,
    Sri
  • 900697
    900697 Member Posts: 50
    i used the event store at processor level.

    Thanks,
    Sri
  • 722711
    722711 Member Posts: 91
    There appears to be an issue in the way it stores TupleValues in rdbms. Could you please open a bug and we can look into fixing this in a future release.
This discussion has been closed.