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 

Time lag to handle Deadlock in DB2

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database
View previous topic :: View next topic  
Author Message
Rahull
Beginner


Joined: 29 Jan 2004
Posts: 62
Topics: 19

PostPosted: Tue Jul 25, 2006 3:24 pm    Post subject: Time lag to handle Deadlock in DB2 Reply with quote

Hi,

In case of deadlock of Db2 table, my batch program abend with 911. Is there any way of adding parameter for eg some scaler function which we can add in Db2 cobol program so that program try more then 1 time before abending.

I knew one solution where I will accept time and add 200milesecond and perform loop 3 times. Thus giving a gap of 6 sec in case of deadlock. Is there any scaler function we can use ?

Suggest other possible solution please.

Thanks
Rahul
Back to top
View user's profile Send private message
CZerfas
Intermediate


Joined: 31 Jan 2003
Posts: 211
Topics: 8

PostPosted: Wed Jul 26, 2006 1:37 am    Post subject: Reply with quote

Hello Rahul,

in case of a deadlock, DB2 not just returns -911 and gives the program the control to decide what to do next, but DB2 rolls back one of the two clashers (the one with the least amont of locks accquired), and after that you have to code a real restart within your coding.

In case of an unavailable ressource because of a timeout (waiting longer than a defined timespan for a lock) the strategie described in your post, i.e. waiting for a while and simply trying again, will work, but a deadlock is another thing.

regards
Christian
Back to top
View user's profile Send private message
videlord
Beginner


Joined: 09 Dec 2004
Posts: 147
Topics: 19

PostPosted: Wed Jul 26, 2006 12:09 pm    Post subject: Reply with quote

I agree with Christian's opinion.
If dead lock happen, you have to check your progran logic first, to avoid dead lock.
If timeout, we can consider waiting and retrying.
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 -> Database 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