10.2 Event Types

The following table describes each event type:

Table 10-3 Event Types

Event Type

Interpretation

1

insert field

2

update field

3

update field (remove all values)

4

delete row

5

insert row (query-back)

6

update row (query-back)

7

insert field (query-back)

8

update field (query-back)

Event types are in four major categories. Some categories overlap. The following table describes each category and indicates which event types are members:

Table 10-4 Event Categories and Types

Event Category

Event Types

Per-field (attribute)

1, 2, 3, 7, 8

Per-row (object)

4, 5, 6

Non-query-back

1, 2, 3, 4

Query-back

5, 6, 7, 8

Per-field, non-query-back

1, 2, 3

Per-field, query-back

7, 8

Per-row, non-query-back

4

Per-row, query-back

5, 6

In general, a combination of event types from each category yields the best trade-off in terms of space, time, implementation complexity, and performance.

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 take precedence over their non-query-back counterparts. 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 take precedence over 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 available 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 10-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:

Table 10-6 An Inserted Row in the usr Table

idu

fname

lname

photo

1

Jack

Frost

0xAAAA

The following table shows the current contents of usr after the row has been updated:

Table 10-7 An Updated Row in the usr Table

idu

fname

lname

photo

1

John

Doe

0xBBBB

Insert Field

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 10-8 Event Log Table: Insert Field

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>

Update Field

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 10-9 Event Log Table: Update Field

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>

Update Field (Remove-All-Values)

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 10-10 Event Log Table: Update Field (Remove-All-Values

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>

Delete Row

The table below shows the contents of the event log table after the row in table usr has been deleted.

Table 10-11 Event Log Table: Delete Row

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>

Insert Row (Query-Back)

The following table shows the contents of the event log table after a new row is inserted into table usr.

Table 10-12 Event Log Table: Insert Row (Query-Back)

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>

Update Row (Query-Back)

The table below shows the contents of the event log table after the row in table usr has been updated.

Table 10-13 Event Log Table: Update Row (Query-Back)

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>

Insert Field (Query-Back)

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 10-14 Event Log Table: Insert Field (Query-Back)

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>

Update Field (Query-Back)

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 10-15 Event Log Table: Update Field (Query-Back)

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>