View previous topic :: View next topic |
Author |
Message |
Rahull Beginner
Joined: 29 Jan 2004 Posts: 62 Topics: 19
|
Posted: Tue Jul 25, 2006 3:24 pm Post subject: Time lag to handle Deadlock in DB2 |
|
|
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 |
|
|
CZerfas Intermediate
Joined: 31 Jan 2003 Posts: 211 Topics: 8
|
Posted: Wed Jul 26, 2006 1:37 am Post subject: |
|
|
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 |
|
|
videlord Beginner
Joined: 09 Dec 2004 Posts: 147 Topics: 19
|
Posted: Wed Jul 26, 2006 12:09 pm Post subject: |
|
|
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 |
|
|
|
|