Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
Database Servers
DB2InformixIngresMS SQLOraclePervasive.SQLPostgreSQLProgressSybase
Desktop Databases
FileMakerFoxProMS AccessParadox
General
General DB TopicsDatabase Theory
Related Topics
Java Development.NET DevelopmentVB DevelopmentMore Topics ...

Database Forum / DB2 Topics / March 2006

Tip: Looking for answers? Try searching our database.

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

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
jwt007 - 17 Mar 2006 15:45 GMT
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
Knut Stolze - 20 Mar 2006 11:25 GMT
> Hello everyone,
>
[quoted text clipped - 40 lines]
> 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.

Signature

Knut Stolze
DB2 Information Integration Development
IBM Germany

jwt007 - 21 Mar 2006 19:43 GMT
Thanks Knut,

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

- Jeff
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.