Transmit information using dbevents

For using rules to send information outside the database, I believe you need
to use a "staging table".  Put a rule on the table of interest which copies
the data to another table, then raises a dbevent to indicate that there 
*may* be information to send elsewhere.  An external program is waiting on
the dbevent, and when it is raised, it checks the staging table.  If any
new rows are there, it sends/writes/whatever with them and deletes them.

Since the staging table is in the database, if the original transaction is
rolled back, so will the added rows on the staging table.  Normal locking will
keep the external program from seeing the new rows until after the trans-
action has committed.  The external program, of course, needs to be able
to wake up, find nothing to do, and go back to sleep without complaining
(in the case where the transaction was rolled back).

If the updates are coming fast, there may be some contention on the staging
table, but I think this is the only way to do it reliably with the current
rule implementation.

  -- Brad Whitlock, Honeywell MICRO SWITCH
Ingres Q & A
To William's Home Page

© William Yuan 2000

Email William