473,587 Members | 2,637 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 "recordHeaderBu ffer" 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*) (recordHeaderBu ffer + 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 2898
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 "recordHeaderBu ffer" 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*) (recordHeaderBu ffer + 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
4007
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 than the one I think he will provide. The test data, A:\\"514650.txt", appears at the end of the program. The problem is that the program won't read this file and the debugger as far as i know how to work it won't point out the mistake of any....
4
1832
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) is present in the same directory. When it prompt enter your selection from the menu, it will just stuck there so I cant even create a new entry and thus I cant check the modify function in my program. If it's not present, it will create a...
7
2603
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 subtle problems, such as the fact that a text file may wrap lines. It will be appearing on my website as soon as I get update access, assuming no one finds anything wrong with it. /*
7
13260
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 the rank and suit of its second card. Note that the two cards in a hand may be entered in any order; it’s not necessarily the case that the highest card will appear first, for example. Your program will then determine whether the hand is valid, and...
3
8146
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 soon as it hits the statement: s = serial.Serial(i) I get the error:
20
2598
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 when you give it 2 or more words, but when there's only 1 word the results vary depending on whether it's on Windows or Linux: under MSVC it displays no output (as it should); under gcc/Linux it instead gives "Segmentation fault". Any ideas...
2
3806
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 enclosed are the errors I'm getting and the code Vehicle.cpp Vehicle.cpp(35) : error C2511: 'Person::Person(Person &)' : overloaded member fu nction not found in 'Person' Vehicle.cpp(10) : see declaration of 'Person'
2
1674
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
7927
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
7857
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8220
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
7981
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8222
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6632
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
5723
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5396
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
3846
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...

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.