jwt007 wrote:
Hello everyone,
I have a very specific need to detect rollbacks within a certain table
in the database.
To do this I am actively monitoring the transaction log with a small
C++ program (using the API db2ReadLog).
So far it is working great for the most part but I have a simple
question which I hope someone can either confirm or deny for me.
When parsing an UPDATE record, the DMS record header "should" give me a
function identifier of 120 (according to the documentation):
If "recordHeaderBuffer" is a pointer to the DMS record header. Then
position 1 specifies the type of record header ( 1 == DMS ). And
position 2 specifies the function identifier (unsigned char).
So:
switch ( *(unsigned char*) (recordHeaderBuffer + 1) ) {
case 114:
cout << "UPDATE 114 DETECTED" << endl ;
case 120:
cout << "UPDATE 120 DETECTED" << endl ;
default:
cout << "Some other function" << endl ;
}
This should by a simple update catch the "UPDATE 120" block, but
instead it catches the "UPDATE 114" block.
Value Definition
102 Add columns to table
104 Undo add columns
106 Delete record
110 Undo insert record
111 Undo delete record
112 Undo update record
118 Insert record
120 Update record
However, no matter which way I slice it, and update always gives me a
function identifier of "114" for a simple update.
The thing is that the documentation for the DB2 UDB Log Records is not
entirely complete. Code 114 is an "exclusiVe update change only" log
record. So it is an update log record - whatever this means exactly.
--
Knut Stolze
DB2 Information Integration Development
IBM Germany