Standard Event Processing With Row Removal

How to:

The standard event processing with row removal technique assumes that the source table is used to pass the data to the adapter and that the table rows are not required to persist. The Table Listener periodically queries the source table. When it finds a row, it reads it and returns it to the file disposition specified when the port is configured via an XML document. To ensure that the row is not read again when the listener next queries the table, the listener deletes the row from the table.

Note: Event processing may be limited for some non-relational databases due to the functionality of the database and its interaction with the iWay server component. For more information on the iWay server component, see the iWay Data Adapter Administrator User's Guide or consult your DBA.

The following figure illustrates standard event processing with row removal.

  1. Your application inserts a new row into the source table.
  2. The listener queries the source table and copies the new row to an XML document and sends it to the destination defined in the port disposition using the File protocol.
  3. The listener deletes the source table row to ensure that the row is not read again when the listener next queries the table.
  4. The application inserts a new row into the source table.

The process repeats itself.


Top of page

x
Procedure: How to Implement Standard Event Processing With Row Removal

To implement the standard event processing with row removal technique:

  1. Configure a Table Listener.
  2. In addition to the required listener properties, provide values for the following optional properties:

    SQL Query: the SQL SELECT statement that identifies the source table to which the adapter listens and with which it queries the table.

    Post Query: the query that identifies the rows that the adapter automatically deletes from the table.

For detailed instructions about configuring a listener, see How to Create a Channel. For information about Post query operators, see The Post-query Parameter Operators.



Example: Listening to stock_prices Using the Row Removal Technique

In this example, you listen to the stock_prices table using the row removal technique.

SQL> describe stock_prices
Name                                      Null?    Type
----------------------------------------- -------- -----------
RIC                                       NOT NULL VARCHAR2(6)
PRICE                                              NUMBER(7,2)
UPDATED                                            DATE

When a record is added to stock_prices, an XML document is generated with the contents of the record.

The location to which the document is saved is specified in the configuration of the port disposition property (using the File protocol) associated with this Table Listener.

After generating the document, the record is deleted from the table.

  1. Configure the listener by specifying the following properties when creating the channel.
    1. In the Host field, provide the name or URL of the machine on which the database is installed.
    2. In the Port field, provide the name of the port on which the Host database is listening.
    3. In the User Name field, provide the user name that is registered with the back-end RDBMS.
    4. In the Password field, provide the Oracle Applications user ID authorized to access the Oracle Applications system.
    5. For the SQL Query, use select * from stock_prices.
    6. For the Post Query, use delete from stock_price where ?RIC.
    7. For Polling Interval, specify an interval in seconds.

      For a description of these properties, see The Post-query Parameter Operators.

  2. For more information on configuring a listener, see How to Create a Channel.

iWay Software