473,395 Members | 1,720 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

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
2 2884
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: muser | last post by:
Can anyone run this program through their compiler or if they can see a logical error please point it out. I have my tutor working on it at the moment but I would rather a less ambigious response...
4
by: kimimaro | last post by:
Thank you for your help I think I know what the problem is. Firstly the add_record cannot read the record.txt or something if the record.txt (in which I used it to store the details of each record)...
7
by: Malcolm | last post by:
This is a program to convert a text file to a C string. It is offered as a service to the comp.lang.c community. Originally I thought it would be a five minute job to program. In fact there are...
7
by: ibtc209 | last post by:
I just started programming in C, and I need some help with this problem. Your program will read the information about one MiniPoker hand, namely the rank and suit of the hand’s first card, and...
3
by: Ron Jackson | last post by:
I am using Python 2.5 on Windows XP. I have installed Pyserial and win32all extensions. When I try to run the example program scan.py (included below), or any other program using pyserial, as...
20
by: Francine.Neary | last post by:
I am learning C, having fun with strings & pointers at the moment! The following program is my solution to an exercise to take an input, strip the first word, and output the rest. It works fine...
2
by: Warren Hoskins | last post by:
I'm going to have to break this up into files however I receiving errors when I try to compile this. I am confused about this program Please help.I.m using Visual C++ platform, XP operating system ...
2
by: Army1987 | last post by:
Is this program legal C89? /* no headers included */ int main(void) { if (sizeof (exit(0), 0), ((void (* )(int))&exit)( (puts((const char *)"hello, world"), 0) ), 0) {
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.