|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Problem with CURRENT_TIMESTAMP |
« View previous topic :: View next topic » |
Author |
Message
|
hewingt |
Posted: Tue Sep 14, 2004 10:47 pm Post subject: Problem with CURRENT_TIMESTAMP |
|
|
Newbie
Joined: 10 Sep 2004 Posts: 3 Location: London
|
I am inserting records into an Oracle database after processing in a database node where one of the expressions is CURRENT_TIMESTAMP but the time being evaluated is the current time or the current time + or - 1 minute. There appears to be no constancy as to what answer is given. Any ideas on how I could always get the current time accurately?
Thanks,
Toby Hewing |
|
Back to top |
|
 |
PGoodhart |
Posted: Wed Sep 15, 2004 6:09 am Post subject: |
|
|
Master
Joined: 17 Jun 2004 Posts: 278 Location: Harrisburg PA
|
Can you use the ORACLE database function for current timestamp rather then the MQ function CURRENT_TIMESTAMP? It will be more accurate when dealing with the database insert. Then you will have the actual insert time instead of a time that might be off for a bunch of different reasons.
Otherwise check your broker server time and your ORACLE Server time and see if they are different. (A minute off you should be able to tell, much less and you won't be able to without some sort of time sync tool.) _________________ Patrick Goodhart
MQ Admin/Web Developer/Consultant
WebSphere Application Server Admin |
|
Back to top |
|
 |
kirani |
Posted: Wed Sep 15, 2004 3:19 pm Post subject: |
|
|
Jedi Knight
Joined: 05 Sep 2001 Posts: 3779 Location: Torrance, CA, USA
|
WMQI returns you the same timestamp for each call to this function in the same node. So if you are calling this function in 5 different places in your compute node, they all will return you the same value.
As patrick said, use DB timestamp function. _________________ Kiran
IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries
|
|
Back to top |
|
 |
hewingt |
Posted: Thu Sep 16, 2004 10:58 pm Post subject: |
|
|
Newbie
Joined: 10 Sep 2004 Posts: 3 Location: London
|
I'm feeding multiple messages so I should be getting individual timestamps. Below is a cut down version of the trace and you can clearly see the time being returned is in variance with the time of the trace.
2004-09-10 15:33:32.849740 evaluating 'CURRENT_TIMESTAMP' at (24, 33); result was 'TIMESTAMP '2004-09-10 15:34:32.815738''.
2004-09-10 15:33:46.684752 evaluating 'CURRENT_TIMESTAMP' at (24, 33); result was 'TIMESTAMP '2004-09-10 15:34:46.672149''.
2004-09-10 15:33:57.470308 evaluating 'CURRENT_TIMESTAMP' at (24, 33); result was 'TIMESTAMP '2004-09-10 15:34:57.458423''.
2004-09-10 15:34:09.999857 evaluating 'CURRENT_TIMESTAMP' at (24, 33); result was 'TIMESTAMP '2004-09-10 15:34:09.988102''.
2004-09-10 15:34:22.379984 evaluating 'CURRENT_TIMESTAMP' at (24, 33); result was 'TIMESTAMP '2004-09-10 15:34:22.367990''.
2004-09-10 15:34:35.079260 evaluating 'CURRENT_TIMESTAMP' at (24, 33); result was 'TIMESTAMP '2004-09-10 15:34:35.067466''.
2004-09-10 15:34:47.287612 evaluating 'CURRENT_TIMESTAMP' at (24, 33); result was 'TIMESTAMP '2004-09-10 15:34:47.275829''.
2004-09-10 15:35:09.475810 evaluating 'CURRENT_TIMESTAMP' at (24, 33); result was 'TIMESTAMP '2004-09-10 15:34:09.464028''.
2004-09-10 15:35:20.572640 evaluating 'CURRENT_TIMESTAMP' at (24, 33); result was 'TIMESTAMP '2004-09-10 15:34:20.560512''.
2004-09-10 15:35:40.284308 evaluating 'CURRENT_TIMESTAMP' at (24, 33); result was 'TIMESTAMP '2004-09-10 15:36:40.195831''.
2004-09-10 15:35:49.251528 evaluating 'CURRENT_TIMESTAMP' at (24, 33); result was 'TIMESTAMP '2004-09-10 15:36:49.243373''.
This is just out of interest now as I'm going to use the Database time as suggested.
Thanks. |
|
Back to top |
|
 |
kirani |
Posted: Fri Sep 17, 2004 8:38 am Post subject: |
|
|
Jedi Knight
Joined: 05 Sep 2001 Posts: 3779 Location: Torrance, CA, USA
|
Quote: |
2004-09-10 15:33:32.849740 evaluating 'CURRENT_TIMESTAMP' at (24, 33); result was 'TIMESTAMP '2004-09-10 15:34:32.815738''.
|
It's interesting to see the first timestamp is always greater than the second timestamp. _________________ Kiran
IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries
|
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|