473,231 Members | 1,987 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,231 software developers and data experts.

Timestamp issue under heavy load

We're seeing very strange behaviour with db2 under heavy load.

We're running our system in GMT and the timezone never changes for
British Summer Time.

Basically the thing we're doing is (using the udb jdbc driver):

"values current timestamp"

get that value and supply it "?" in the next insert statement :

insert into x,y,ts values (x,y,?);

Most of the time ( 99.999...%) this works fine, but what we have found
(due to debug statements etc.) that under heavy system load, the
timestamp inserted via the second statement, is actually 1 hour behind
what it should be.

Any thoughts ?

Jun 23 '06 #1
6 1809
"Chris Burnley" <ch***********@gmail.com> wrote in message
news:11*********************@y41g2000cwy.googlegro ups.com...
We're seeing very strange behaviour with db2 under heavy load.

We're running our system in GMT and the timezone never changes for
British Summer Time.

Basically the thing we're doing is (using the udb jdbc driver):

"values current timestamp"

get that value and supply it "?" in the next insert statement :

insert into x,y,ts values (x,y,?);

Most of the time ( 99.999...%) this works fine, but what we have found
(due to debug statements etc.) that under heavy system load, the
timestamp inserted via the second statement, is actually 1 hour behind
what it should be.

Any thoughts ?


Is there some reason why you don't use this:

insert into x,y,ts values (x, y, current_timestamp);
Jun 23 '06 #2
Yes there is. Basically we need to use the timestamp in another
statement later on. It is part of a key to the table we are insert into
to.
Mark A wrote:
"Chris Burnley" <ch***********@gmail.com> wrote in message
news:11*********************@y41g2000cwy.googlegro ups.com...
We're seeing very strange behaviour with db2 under heavy load.

We're running our system in GMT and the timezone never changes for
British Summer Time.

Basically the thing we're doing is (using the udb jdbc driver):

"values current timestamp"

get that value and supply it "?" in the next insert statement :

insert into x,y,ts values (x,y,?);

Most of the time ( 99.999...%) this works fine, but what we have found
(due to debug statements etc.) that under heavy system load, the
timestamp inserted via the second statement, is actually 1 hour behind
what it should be.

Any thoughts ?


Is there some reason why you don't use this:

insert into x,y,ts values (x, y, current_timestamp);


Jun 23 '06 #3
"Chris Burnley" <ch***********@gmail.com> wrote in message
news:11*********************@g10g2000cwb.googlegro ups.com...
Yes there is. Basically we need to use the timestamp in another
statement later on. It is part of a key to the table we are insert into
to.


I would try this to see if it helps:

select current_timestamp from sysibm.sysdummy1;
Jun 23 '06 #4
what is the problem with :

select ts from new table (insert into table (x,y,ts) values (x,y,current
timestamp) ?

"Chris Burnley" <ch***********@gmail.com> wrote in message
news:11*********************@g10g2000cwb.googlegro ups.com...
Yes there is. Basically we need to use the timestamp in another
statement later on. It is part of a key to the table we are insert into
to.
Mark A wrote:
"Chris Burnley" <ch***********@gmail.com> wrote in message
news:11*********************@y41g2000cwy.googlegro ups.com...
> We're seeing very strange behaviour with db2 under heavy load.
>
> We're running our system in GMT and the timezone never changes for
> British Summer Time.
>
> Basically the thing we're doing is (using the udb jdbc driver):
>
> "values current timestamp"
>
> get that value and supply it "?" in the next insert statement :
>
> insert into x,y,ts values (x,y,?);
>
> Most of the time ( 99.999...%) this works fine, but what we have found
> (due to debug statements etc.) that under heavy system load, the
> timestamp inserted via the second statement, is actually 1 hour behind
> what it should be.
>
> Any thoughts ?
>


Is there some reason why you don't use this:

insert into x,y,ts values (x, y, current_timestamp);

Jun 23 '06 #5
You're both missing the point. It works 99.99999% of the time,
occasionaly it doesn't work. Usually under heavy load. This to me,
smells like a race condition of some sort in the db2 driver.
Paul Peters wrote:
what is the problem with :

select ts from new table (insert into table (x,y,ts) values (x,y,current
timestamp) ?

"Chris Burnley" <ch***********@gmail.com> wrote in message
news:11*********************@g10g2000cwb.googlegro ups.com...
Yes there is. Basically we need to use the timestamp in another
statement later on. It is part of a key to the table we are insert into
to.
Mark A wrote:
"Chris Burnley" <ch***********@gmail.com> wrote in message
news:11*********************@y41g2000cwy.googlegro ups.com...
> We're seeing very strange behaviour with db2 under heavy load.
>
> We're running our system in GMT and the timezone never changes for
> British Summer Time.
>
> Basically the thing we're doing is (using the udb jdbc driver):
>
> "values current timestamp"
>
> get that value and supply it "?" in the next insert statement :
>
> insert into x,y,ts values (x,y,?);
>
> Most of the time ( 99.999...%) this works fine, but what we have found
> (due to debug statements etc.) that under heavy system load, the
> timestamp inserted via the second statement, is actually 1 hour behind
> what it should be.
>
> Any thoughts ?
>

Is there some reason why you don't use this:

insert into x,y,ts values (x, y, current_timestamp);


Jun 23 '06 #6
Chris Burnley wrote:
You're both missing the point. It works 99.99999% of the time,
occasionaly it doesn't work. Usually under heavy load. This to me,
smells like a race condition of some sort in the db2 driver.

If you think it's a DB2 bug please open a PMR.
Try this alternative:
TIMESTAMP(GENERATE_UNIQUE())

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

IOD Conference
http://www.ibm.com/software/data/ond...ness/conf2006/
Jun 23 '06 #7

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

Similar topics

13
by: perplexed | last post by:
How do you convert a user inputted date to a unix timestamp before insterting it into your database? I have a form, with a textfield for a date that the user inputs in the format mm-dd-yyyy and...
0
by: Kayra Otaner | last post by:
Hi all, I want to get your opinions on how to increase available/free memory and performance on a heavy volume database server. I have MySQL 4.0.13 running on RH 7.2 replicated to another RH...
0
by: kayra | last post by:
Hi all, I want to get your opinions on how to increase available/free memory and performance on a heavy volume database server. I have MySQL 4.0.13 running on RH 7.2 replicated to another RH...
2
by: jay | last post by:
hi, Question on Load/import command. consider a sample table create table table_name ( col1 timestamp not null default current timestamp, col2 int, col3 int, col4 int, primary key(col1) );...
6
by: Robert Schuldenfrei | last post by:
Dear NG, As expected, when I went to implement TIMESTAMP, I failed. With the help of Kevin Yu, I got the 2 code segments at the bottom working using a WHERE clause that checks all columns. ...
1
by: Roger Twomey | last post by:
I have a database that I don't want to lock. I decided that before any updates can occur I would check a timestamp value and ensure that nobody else updated before I did (avoiding the 'last update...
6
by: Jim C. Nasby | last post by:
Is there any reason why there isn't a predefined cast to go from a timestamp to a varchar? Is there a reason not to add one? -- Jim C. Nasby, Database Consultant jim@nasby.net...
5
by: pankaj_wolfhunter | last post by:
Greetings, In Sybase, a timestamp column is automatically loaded by the DB engine and its in some hex format. This is shown below id timestamp_value ----------- ------------------ 1...
1
by: Frank Swarbrick | last post by:
We're trying to take advantage of the new ROW CHANGE TIMESTAMP option. Here is a simple table: CREATE TABLE "ACCTASGN"."NUMBER_STATUS" ( "STATUS_CODE" CHAR(1) NOT NULL , "STATUS_DESCRIPTION"...
0
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...

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.