467,110 Members | 1,335 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,110 developers. It's quick & easy.

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

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
  • viewed: 2703
Share:
2 Replies
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
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.

Similar topics

7 posts views Thread by Malcolm | last post: by
7 posts views Thread by ibtc209 | last post: by
20 posts views Thread by Francine.Neary@googlemail.com | last post: by
2 posts views Thread by Warren Hoskins | last post: by
2 posts views Thread by Army1987 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.