Regardless of the JDBC Driver Data Synchronization Model utilized, on the JDBC Subscriber Channel, you will need to implement an Event Log for the Publisher Channel if you require receiving data from the data base.
When a JDBC table is updated, publication triggers insert rows into the event log table. The driver utilizes the table_name and the table_key to locate where to find the updated data by performing a search on the table or view specified within the table_name using the value from the table_key value. The Publisher Channel then reads the row returned in the search and updates the Identity Vault.
Depending on the contents of the rows read from the event log table, the Publisher channel might need to retrieve additional information from another view or table before updating the Identity Vault. After updating the Identity Vault, the Publisher channel then marks the rows as processed and may, depending on driver setting, delete the processed row.
Event Log Structure#
record_id#
The record_id column is used to uniquely identify rows in the event log table and order publication events. This column must contain sequential, ascending, positive, unique integer values. Gaps between record_id values no longer prematurely end a polling cycle.table_key#
Format values for this column are exactly the same in all triggers for a logical database class.For example, for the usr table referenced throughout this chapter, this column’s value might be:
idu=1
For the view_usr view referenced throughout this chapter, this column’s value might be
pk_empno=1
For a hypothetical compound primary key (one containing multiple columns), this column’s value might be
pkey1=value1+pkey2=value2.
If primary key values placed in the table_key field contain any of the special characters {, ; ' + " =\ < >}, where { and } contain the set of special characters, delimit the value with double quotes. You
also need to escape the double quote character " as \" and the literal escape character \ as
when they are contained inside a pair of double quotes.
For a hypothetical primary key containing special characters, this column’s value might be:
pkey=",; ' + \" = \\ < >"(Note the double quotes and escaped characters.)
Differences in padding or formatting might result in out-of-order event processing. For performance reasons, remove any unnecessary white space from numeric values. For example, idu=1 is preferred over idu= 1.
status#
The status column indicates the state of a given row. The following table lists permitted values:To be processed, all rows inserted into the event log table must have a status value of N. The remainder of the status characters are used solely by the Publisher channel to designate processed rows. All other characters are reserved for future use.
- N - new
- S - success
- W - warning
- E - error
- F - fatal
Status values are case-sensitive.
Any other values appear to be ignored by the driver. We have "pre-staged" events by setting the value to "X" and then flipping the "X" to "N" to start the driver processing the rows. We can find no documentation as to placing any other values, but it has been our experience.!!event_type Values in this column must be between 1 and 8. All other numbers are reserved for future use.