The following table describes each event type:
Table 12-3 Event Types
Event types are in four major categories. Some categories overlap. The following table describes each category and indicates which event types are members:
Table 12-4 Event Categories and Types
In general, a combination of event types from each category yields the best trade-off in terms of space, time, implementation complexity, and peformance.
Per-field event types are more granular, require more space, and are more complex to implement than per-row event types. Per-row events are less granular, require less space, and are easier to implement than per-field event types.
Query-back event types use less space but require more time to process than non-query-back event types. Non-query-back event types use more space but require less time to process than query-back event types.
Query-back event types trump their non-query-back conterparts. Non-query-back events are ignored if a query-back event is logged for the same field or object. For example, if an event of type 2 (update-field, non-query-back) and 8 (update-field, query-back) are logged on the same field, the type 2 event is ignored in favor of the type 8 event.
Furthermore, query-back row event types trump query-back field event types. For example, if an event type 8 (update field, query-back) and a event type 6 (update row query-back) are logged on the same object, the type 8 event is ignored in favor of the type 6 event.
Query-back events are ignored by the Publisher if the database object no longer exists. They are dependent upon the database object still being around at processing time. Therefore, logged query-back adds and modifies (event types 5, 6, 7, 8) have no effect once the database object they refer to is deleted.
The following table shows the basic correlation between publication event types and the XDS XML generated by the Publisher channel.
Table 12-5 Basic Correlation of Publication Event Types
Event Type |
Resulting XDS |
---|---|
insert |
<add> |
update |
<modify> |
delete |
<delete> |
The following example illustrates XML that the Publisher channel generates for events logged on the usr table for each possible event type.
CREATE TABLE indirect.usr ( idu INTEGER NOT NULL, fname VARCHAR2(64), photo LONGRAW, --... CONSTRAINT pk_usr_idu PRIMARY KEY(idu) );
The following table shows the initial contents of usr after a new row has been inserted:
The following table shows the current contents of usr after the row has been updated:
The table below shows the contents of the event log table after a new row is inserted into table usr. The value for column photo has been Base64-encoded. The Base64-encoded equivalent of 0xAAAA is qqo=.
Table 12-8 Event Log Table: Type 1
event_type |
table |
table_key |
column_name |
old_value |
new_value |
---|---|---|---|---|---|
1 |
usr |
idu=1 |
fname |
NULL |
Jack |
1 |
usr |
idu=1 |
lname |
NULL |
Frost |
1 |
usr |
idu=1 |
photo |
NULL |
qqo= |
The Publisher channel generates the following XML:
<add class-name="usr"> <association>idu=1,table=usr,schema=indirect </association> <add-attr attr-name="fname"> <value type="string">Jack</value> </add-attr> <add-attr attr-name="lname"> <value type="string">Frost</value> </add-attr> <add-attr attr-name="photo"> <value type="octet">qqo=</value> </add-attr> </add>
The following table shows the contents of the event log table after the row in table usr has been updated. The values for column photo has been Base64-encoded. The Base64-encoded equivalent of 0xBBBB is u7s=.
Table 12-9 Event Log Table: Type 2
event_type |
table |
table_key |
column_name |
old_value |
new_value |
---|---|---|---|---|---|
2 |
usr |
idu=1 |
fname |
Jack |
John |
2 |
usr |
idu=1 |
lname |
Frost |
Doe |
2 |
usr |
idu=1 |
photo |
qqo= |
u7s= |
The Publisher channel generates the following XML:
<modify class-name="usr"> <association>idu=1,table=usr,schema=indirect </association> <modify-attr attr-name="fname"> <remove-value> <value type="string">Jack</value> </remove-value> <add-value> <value type="string">John</value> </add-value> </modify-attr> <modify-attr attr-name="lname"> <remove-value> <value type="string">Frost</value> </remove-value> <add-value> <value type="string">Doe</value> </add-value> </modify-attr> <modify-attr attr-name="photo"> <remove-value> <value type="octet">qqo=</value> </remove-value> <add-value> <value type="octet">u7s=</value> </add-value> </modify-attr> </modify>
The following table shows the contents of the event log table after the row in table usr has been updated. The value for column photo has been Base64-encoded.
Table 12-10 Event Log Table: Type 3
event_type |
table |
table_key |
column_name |
old_value |
new_value |
---|---|---|---|---|---|
3 |
usr |
idu=1 |
fname |
Jack |
John |
3 |
usr |
idu=1 |
lname |
Frost |
Doe |
3 |
usr |
idu=1 |
photo |
qqo= |
u7s= |
The Publisher channel generates the following XML:
<modify class-name="usr"> <association>idu=1,table=usr,schema=indirect </association> <modify-attr attr-name="fname"> <remove-all-values/> <add-value> <value type="string">John</value> </add-value> </modify-attr> <modify-attr attr-name="lname"> <remove-all-values/> <add-value> <value type="string">Doe</value> </add-value> </modify-attr> <modify-attr attr-name="photo"> <remove-all-values/> <add-value> <value type="octet">u7s=</value> </add-value> </modify-attr> </modify>
The table below shows the contents of the event log table after the row in table usr has been deleted.
Table 12-11 Event Log Table: Type 4
event_type |
table |
table_key |
column_name |
old_value |
new_value |
---|---|---|---|---|---|
4 |
usr |
idu=1 |
NULL |
NULL |
NULL |
The Publisher channel generates the following XML:
<delete class-name="usr"> <association>idu=1,table=usr,schema=indirect </association> </delete>
The following table shows the contents of the event log table after a new row is inserted into table usr.
Table 12-12 Event Log Table: Type 5
event_type |
table |
table_key |
column_name |
old_value |
new_value |
---|---|---|---|---|---|
5 |
usr |
idu=1 |
NULL |
NULL |
NULL |
The Publisher channel generates the following XML. The values reflect the current contents of table usr, not the initial contents.
<add class-name="usr"> <association>idu=1,table=usr,schema=indirect </association> <add-attr attr-name="fname"> <value type="string">John</value> </add-attr> <add-attr attr-name="lname"> <value type="string">Doe</value> </add-attr> <add-attr attr-name="photo"> <value type="octet">u7s=</value> </add-attr> </add>
The table below shows the contents of the event log table after the row in table usr has been updated.
Table 12-13 Event Log Table: Type 6
event_type |
table |
table_key |
column_name |
old_value |
new_value |
---|---|---|---|---|---|
6 |
usr |
idu=1 |
NULL |
NULL |
NULL |
The Publisher channel generates the following XML. The values reflect the current contents of table usr, not the initial contents.
<modify class-name="usr"> <association>idu=1,table=usr,schema=indirect </association> <modify-attr attr-name="fname"> <remove-all-values/> <add-value> <value type="string">John</value> </add-value> </modify-attr> <modify-attr attr-name="lname"> <remove-all-values/> <add-value> <value type="string">Doe</value> </add-value> </modify-attr> <modify-attr attr-name="photo"> <remove-all-values/> <add-value> <value type="octet">u7s=</value> </add-value> </modify-attr> </modify>
The following table shows the contents of the event log table after a new row is inserted into table usr. Old and new values are omitted because they are not used.
Table 12-14 Event Log Table: Type 7
event_type |
table |
table_key |
column_name |
old_value |
new_value |
---|---|---|---|---|---|
7 |
usr |
idu=1 |
fname |
NULL |
NULL |
7 |
usr |
idu=1 |
lname |
NULL |
NULL |
7 |
usr |
idu=1 |
photo |
NULL |
NULL |
The Publisher channel generates the following XML. The values reflect the current contents of table usr, not the initial contents.
<add class-name="usr"> <association>idu=1,table=usr,schema=indirect </association> <add-attr attr-name="fname"> <value type="string">John</value> </add-attr> <add-attr attr-name="lname"> <value type="string">Doe</value> </add-attr> <add-attr attr-name="photo"> <value type="octet">u7s=</value> </add-attr> </add>
The following table shows the contents of the event log table after the row in table usr has been updated. Old and new values are omitted because they are not used.
Table 12-15 Event Log Table: Type 8
event_type |
table |
table_key |
column_name |
old_value |
new_value |
---|---|---|---|---|---|
8 |
usr |
idu=1 |
fname |
NULL |
NULL |
8 |
usr |
idu=1 |
lname |
NULL |
NULL |
8 |
usr |
idu=1 |
photo |
NULL |
NULL |
The Publisher channel generates the following XML. The values reflect the current contents of table usr, not the initial contents.
<modify class-name="usr"> <association>idu=1,table=usr,schema=indirect </association> <modify-attr attr-name="fname"> <remove-all-values/> <add-value> <value type="string">John</value> </add-value> </modify-attr> <modify-attr attr-name="lname"> <remove-all-values/> <add-value> <value type="string">Doe</value> </add-value> </modify-attr> <modify-attr attr-name="photo"> <remove-all-values/> <add-value> <value type="octet">u7s=</value> </add-value> </modify-attr> </modify>