Hi,
I've written a couple adapter type applications to grab insert, update and delete operations on desired tables of my DB2 database. One application is based on installing and using triggers on the desired tables to capture the inserts,updates and deletes as they occur. The second and more recent application reads the UDB database logs using the db2ReadLog API function.
Both of these methods work well but I have found that occasionally I will capture a block of deletes, and subsequent updates to a table where the order is , for example, 30 deletes then 30 updates to a table. these operations are captured in the correct order using triggers but when using db2ReadLog(), there may be a few inserts then deletes then the remainder of the inserts. This results in missing data in my replication target, because the deletes came after some of the inserts. a simple illustration follows:
Initially, Records for data 1 thru 9 in one table exist in the database.
Step 1 delete records 1 thru 9.
Step 2, insert data 1 thru 9.
Results: 9 new values exist in my replication database.
Triggers application captures the order as - Delete 1 thru 9 then Insert 1 thru 9.
BUT,
db2ReadLog function's, read order is: Insert 7,8,9 - Delete 1 thru 9 - insert 1 thru 6.
The result is that records 7,8,9 are missing in my replication database.
Has anyone else had past experience with this?
Thanks,
1477v