473,769 Members | 2,106 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Hepl please - Product stop to work on DB2 v9.1!

Hello.

Our product works fine on all 7.x and 8.x DB2 versions. But stops to
work on DB2 v9.1.

The main problem is - duplicate primary key (sqlcode=-803) happens when
inserting records in QUEUE table.
The primary key of QUEUE table is - 3 fields - QID CHAR(4), PRI INT
and QTIME TIMESTAMP.
When inserting records into QTIME table we are using the "CURRENT
TIMESTAMP" value for QTIME field.
And this is the root of problem. In DB2 v9.1 "CURRENT TIMESTAMP"
returns a lot of duplicated values(!) in contrast to previous versions
of DB2.

To solve DUP_KEY error we have added autoinremented field to the
primary key of QUEUE table and can see that all things starts to work
but there are too many duplicated TIMESTAMP values in QTIME field.
Looks like in DB2 v9.1 only first 3 digits are used in microseconds
fraction of timestamp.
Why this happens in new version of DB2? We see that in older DB2
versions all 6 digits were used in microseconds fraction in TIMESTAMP.

Is it a bug? Or "feature" of new DB2?
Should we wait for fixpack or think about workarounds?...

Could you please help?

WBR,
Dmitry.

Oct 31 '06 #1
5 2656
Have you opened a PMR with IBM support to find out whether it is a bug
or not?

Larry Edelstein

Dmitry Bond. wrote:
Hello.

Our product works fine on all 7.x and 8.x DB2 versions. But stops to
work on DB2 v9.1.

The main problem is - duplicate primary key (sqlcode=-803) happens when
inserting records in QUEUE table.
The primary key of QUEUE table is - 3 fields - QID CHAR(4), PRI INT
and QTIME TIMESTAMP.
When inserting records into QTIME table we are using the "CURRENT
TIMESTAMP" value for QTIME field.
And this is the root of problem. In DB2 v9.1 "CURRENT TIMESTAMP"
returns a lot of duplicated values(!) in contrast to previous versions
of DB2.

To solve DUP_KEY error we have added autoinremented field to the
primary key of QUEUE table and can see that all things starts to work
but there are too many duplicated TIMESTAMP values in QTIME field.
Looks like in DB2 v9.1 only first 3 digits are used in microseconds
fraction of timestamp.
Why this happens in new version of DB2? We see that in older DB2
versions all 6 digits were used in microseconds fraction in TIMESTAMP.

Is it a bug? Or "feature" of new DB2?
Should we wait for fixpack or think about workarounds?...

Could you please help?

WBR,
Dmitry.
Oct 31 '06 #2
Dmitry Bond. wrote:
Hello.

Our product works fine on all 7.x and 8.x DB2 versions. But stops to
work on DB2 v9.1.

The main problem is - duplicate primary key (sqlcode=-803) happens when
inserting records in QUEUE table.
The primary key of QUEUE table is - 3 fields - QID CHAR(4), PRI INT
and QTIME TIMESTAMP.
When inserting records into QTIME table we are using the "CURRENT
TIMESTAMP" value for QTIME field.
And this is the root of problem. In DB2 v9.1 "CURRENT TIMESTAMP"
returns a lot of duplicated values(!) in contrast to previous versions
of DB2.

To solve DUP_KEY error we have added autoinremented field to the
primary key of QUEUE table and can see that all things starts to work
but there are too many duplicated TIMESTAMP values in QTIME field.
Looks like in DB2 v9.1 only first 3 digits are used in microseconds
fraction of timestamp.
Why this happens in new version of DB2? We see that in older DB2
versions all 6 digits were used in microseconds fraction in TIMESTAMP.

Is it a bug? Or "feature" of new DB2?
Should we wait for fixpack or think about workarounds?...
The granularity of CURRENT TIMESTAMP is bounded by the system clock.
So if you only get 1/1000 of seconds that's where it's coming from.
There is no rule whatsoever that defined CURRENT TIMESTAMP to produce
unique values.
However pre-DB2 9 code internaly made different invocations of CURRENT
TIMESTAMP unique (which is where you saw the extra digits from.
As concurrency and CPU speeds increase this is causing serious latching
problems, hence the change.
So much for the background. Now for the solution:
TIMESTAMP(GENER ATE_UNQIQUE()) will give a guaranteed unique timestamp
for every invocation even within a single SQL statements (good for mass
inserts)

So, no bug, it's working as designed.

Cheers
Serge

--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab

WAIUG Conference
http://www.iiug.org/waiug/present/Fo...Forum2006.html
Oct 31 '06 #3
Serge Rielau wrote:
The granularity of CURRENT TIMESTAMP is bounded by the system clock.
So if you only get 1/1000 of seconds that's where it's coming from.
There is no rule whatsoever that defined CURRENT TIMESTAMP to produce
unique values.
However pre-DB2 9 code internaly made different invocations of CURRENT
TIMESTAMP unique (which is where you saw the extra digits from.
As concurrency and CPU speeds increase this is causing serious latching
problems, hence the change.
So much for the background. Now for the solution:
TIMESTAMP(GENER ATE_UNQIQUE()) will give a guaranteed unique timestamp
for every invocation even within a single SQL statements (good for mass
inserts)

So, no bug, it's working as designed.

Cheers
Serge
--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab
For those of you (like me) who like to copy and paste, there is a
slight typo in the above syntax. It should be:

TIMESTAMP(GENER ATE_UNIQUE())

Oct 31 '06 #4
We have:

db2 'describe values (timestamp(GENE RATE_UNIQUE())) '

SQLDA Information

sqldaid : SQLDA sqldabc: 896 sqln: 20 sqld: 1

Column Information

sqltype sqllen sqlname.data
sqlname.length
-------------------- ------ ------------------------------
--------------
392 TIMESTAMP 26 1
1
So instead of:

create table t1 (c1 timestamp not null default current timestamp)

we will (now) try

create table t1 (c1 timestamp not null default values
(timestamp(GENE RATE_UNIQUE()))

Fails (8.2 tested, manual of 9 does not differ in this).

So would it be possible to have a values construct in the default
clause? (understanding and accepting the non uniqueness of current
timestamp)

Bernard Dhooghe
Mark A wrote:
Serge Rielau wrote:
The granularity of CURRENT TIMESTAMP is bounded by the system clock.
So if you only get 1/1000 of seconds that's where it's coming from.
There is no rule whatsoever that defined CURRENT TIMESTAMP to produce
unique values.
However pre-DB2 9 code internaly made different invocations of CURRENT
TIMESTAMP unique (which is where you saw the extra digits from.
As concurrency and CPU speeds increase this is causing serious latching
problems, hence the change.
So much for the background. Now for the solution:
TIMESTAMP(GENER ATE_UNQIQUE()) will give a guaranteed unique timestamp
for every invocation even within a single SQL statements (good for mass
inserts)

So, no bug, it's working as designed.

Cheers
Serge
--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab

For those of you (like me) who like to copy and paste, there is a
slight typo in the above syntax. It should be:

TIMESTAMP(GENER ATE_UNIQUE())
Nov 2 '06 #5
If this were supported, which it isn't, it would be without the VALUES.
Use a BEFORE TRIGGER.

Cheers
Serge

--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab

WAIUG Conference
http://www.iiug.org/waiug/present/Fo...Forum2006.html
Nov 3 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
584
by: gregory_may | last post by:
Is there a more econimical way to stop people from decompiling my .Net product? I dont have $1900 to spend on the .Net Decompiler Protector. Anyone have any thoughts/experiences with these or simliar products? Is Microsoft working on a solution to this problem? ..Net Decompiler - $1100 http://www.remotesoft.com/salamander/
2
1304
by: Claire Streb | last post by:
Dear Microsoft, You make some great products, really, but I have a request: Please stop taking away functionality from your users. 1) In Visual Studio 6, we had two output folders, Debug and Release. In Visual Studio .NET for C#, the default is to have SIX output folders (bin, bin/Debug, bin/Release, obj, obj/Debug, and obj/Release), and the targets are duplicated (that is, I have two copies of my dll and pdb). Yes, I know we can...
11
11047
by: Paul Aspinall | last post by:
Hi Can anyone offer any hints / tips for creating registration keys / application activation, as software copy protection measures for a Winform app developed in C#? Thanks
8
1122
by: Andy Capon | last post by:
Hi There, We have a medium size project about 2000 source files and 700,000 lines of code, as you can imagine this takes some time to rebuild all. Now our problem is that we have a code generator we have developed that updates some of our classes, as an example lets say I update 50 files. When we do a build the ide builds nearly all of the source files while we swear and then twiddle our thumbs for a couple of hours.
9
23803
by: Paulers | last post by:
Hello vb.net experts :) I am trying to program an app that resides in the system tray and I am trying to put all my main code in sub Main(). I am getting this errormessage at compile: Performing main compilation... vbc : error BC30737: No accessible 'Main' method with an appropriate signature was found in
8
1588
by: Dynamo | last post by:
Hi again, I am constructing a site on a small scale where people can buy nik naks and pay for them via paypal. Everything works fine unless there is only one of an item left for sale. What if 2 people try to buy this item at the same time? I have partially overcome this problem by adding an extra column called status to my catalogue table. When somebody tries to buy the item I have created an interim page where the user is asked to confirm...
2
1695
by: Tyla | last post by:
I have been teaching myself javascript and i am having a huge problem with this form. All it has to do is check that every field has something in it and then post, but as soon as it gets to the document.getElementById('form1').submit(); it throws an error and say that the object is not supported. Here is the code: <script language="javascript"> function check_form(){ if(document.getElementById('name').value == ""){ alert("Enter...
8
2051
by: Richard Maher | last post by:
Hi, I am in a mouseup event for button A and I'd like to disable=false button B before starting some work. Is there anyway that an event for button B can then fire before my event processing for button A's mouseup has completed? I beleive event processing to be single-threaded for good reason but I need a "stop" button and it's no good if it doesn't do anything until the other processing has finished :-)
1
1848
by: theflyingminstrel | last post by:
Hi, I’m having some trouble with a Javascript code, and I was wondering if anyone can help: I am trying to build a price estimator that has multiple fields. I would like the first two fields to have a price value based on a quantity price, so for example 1-10 qantity equals $30, 20-30 quantity equals $40 in the “Total” field). The rest of the fields in the following code work as intended whereas they just add based on the price to the right....
0
9589
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
9423
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
10049
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9997
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,...
1
7413
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
6675
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
5310
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...
1
3965
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2815
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.