By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,021 Members | 912 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,021 IT Pros & Developers. It's quick & easy.

DB2 program to read log files ... incorrect function identifier

P: n/a
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.

I believe that the documentation might be wrong in this case, but was
hoping someone with some more experience with transaction log parsing
may be able to verify this.

Thanks for any help you can offer.

Jeff

Mar 17 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
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
Mar 20 '06 #2

P: n/a
Thanks Knut,

I reached you on this issue over a totally different path =) thanks
again for your help.

- Jeff

Mar 21 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.