Page 1 of 1

Deadlock and Time out

PostPosted: Fri Dec 28, 2012 11:35 am
by fornanthakumar
Hi,

How can we differentiate 911 happened because of deadlock or timeout ?

Sometimes there is question which i frequently asked is "what ever happens the timeout error will be the result ? if the application is waiting for the resource longtime or App A is waiting for App B's resource and vice versa (Deadlock)" Then why the term deadlock silently influencing.. kind of unconcluded the discussion haunting around in my mind.

If time out happens then the resouce will be rolled back until the last commit point , this is -911 happened due to timeout.

in deadlock , any one application will be rolled back thought both application waiting for the resource and -911 happened. In this case why do not DB2 rolled back both applications ?

Regards,
Nanthu.Y

Re: Deadlock and Time out

PostPosted: Fri Dec 28, 2012 1:55 pm
by enrico-sorichetti
in a deadlock when ALL - 1 competitors are <terminated> the survivor will not be in a deadlock any longer
and will happily terminate <normally>

Re: Deadlock and Time out

PostPosted: Fri Dec 28, 2012 2:27 pm
by GuyC
SQLERRD(3) also contains the reason-code which indicates whether a deadlock or timeout occurred. The most common reason codes are:
•00C90088 - deadlock
•00C9008E - timeout

In the log you should also find 1 of the following
DSNT376I

PLAN=plan-name1 WITH CORRELATION-ID=correlation-id1
CONNECTION-ID=connection-id1 LUW-ID=luw-id1 THREAD-INFO=thread-information1
IS TIMED OUT. ONE HOLDER OF THE RESOURCE IS PLAN=plan-name2 WITH
CORRELATION-ID=correlation-id2 CONNECTION-ID=connection-id2 LUW-ID=luw-id2
THREAD-INFO= thread-information2 ON MEMBER member-name

DSNT375I

PLAN=plan-name1 WITH CORRELATION-ID=correlation-id1
CONNECTION-ID=connection-id1 LUW-ID=luw-id1 THREAD-INFO=thread-information1
IS DEADLOCKED WITH PLAN=plan-name2 WITH CORRELATION-ID=correlation-id2
CONNECTION-ID=connection-id2 LUW-ID=luw-id2 THREAD-INFO= thread-information2
ON MEMBER member-name