MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

inconsistent error in update query

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> CICS and Middleware
View previous topic :: View next topic  
Author Message
VINAY19
Beginner


Joined: 14 Jan 2008
Posts: 4
Topics: 2

PostPosted: Tue Jun 10, 2008 8:06 am    Post subject: inconsistent error in update query Reply with quote

hi all,

We are facing a peculiar problem in one of our program. There is query in one of our programs to update a column which is of type timestamp.

There is a query to update this timestamp which is as follows

UPDATE TABLE
SET LOCK_TIMESTAMP = CURR_LOCK_TIMESTAMP
WHERE LOCK_TIMESTAMP < CURR_LOCK_TIMESTAMP
AND .....

There is a particular logic to calculate CURR_LOCK_TIMESTAMP
This query gets executed sometimes successfully and sometimes not. With the same code base.

I want to know what is the possible reason for this. If it fails it should fail every time else it should get executed correctly each time.

If anyone has faced such an issue previously let me know.

thanks in advance.
Back to top
View user's profile Send private message
dbzTHEdinosauer
Supermod


Joined: 20 Oct 2006
Posts: 1411
Topics: 26
Location: germany

PostPosted: Tue Jun 10, 2008 8:45 am    Post subject: Reply with quote

well, to repeat the answer you received in the other forum.

what sql code are you receiving? -180 or -181 means your calculated time stamp is not being calculated correctly - for all times.
Quote:

If it fails it should fail every time else it should get executed correctly each time.


you are trying to blame the computer for bad code. If your timestamp calculation routine has a bug - sometimes it works corrects, sometimes not, then there is your answer.
_________________
Dick Brenholtz
American living in Varel, Germany
Back to top
View user's profile Send private message
VINAY19
Beginner


Joined: 14 Jan 2008
Posts: 4
Topics: 2

PostPosted: Wed Jun 11, 2008 6:58 am    Post subject: Reply with quote

hi all,

Thanks for your replies. The issue is now resolved. I was not getting sqlcode 180 or anything else. The query was failing with an sqlcode 100.

The logic to calculate timestamp is perfect.

There was a logic error in the code.

For people interested to know what was the problem.

The extension of lock was happening only once initially, but it is changed to extend the lock twice now. But the catch is that while extending the lock second time only first two digits of micro seconds in timestamp is taken into account and not the last four and the lag between the first and second extension would be such that it would be only in the last four digits of micro seconds.

So whenever the load was more on db2 the lag would ve reached upto first two digits of microseconds that time i was not gettting any error but in the other cases.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> CICS and Middleware All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
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


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group