IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

What is a deadlock in DB2


IBM Mainframe Forums -> Mainframe Interview Questions
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
ranjitbhingare

New User


Joined: 30 Nov 2005
Posts: 94
Location: PUNE

PostPosted: Fri Jan 05, 2007 10:37 pm
Reply with quote

1. What is a deadlock ?

2. FROM EMP TABLE find the employees with Higest Pay, 2nd Higest Pay, 3rd Higest Pay and 4 th Highest Pay ?

Please help....


Thanks.....
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Fri Jan 05, 2007 11:26 pm
Reply with quote

Hello,

"Deadlock" is also known as "deadly-embrace".

This happens when:

pgma locks row1 in headertable

pgmb locks row33 in detailtable

pgma tries to lock row33 in detailtable but cannot and must wait as the row is already locked - (this is quite normal and happens often - the wait ends when pgmb releases control of detailtable/row33 and pgma continues).

However -

NOW pgmb tries to lock row1 in headertable - it also cannot and must wait - which causes the deadlock. If the database engine does not terminate one of the requests (typically pgmb - the request that completed the deadlock), they will never end.


Your second questions was answered discussed (today) in the DB2 forum.
Back to top
View user's profile Send private message
priyesh.agrawal

Senior Member


Joined: 28 Mar 2005
Posts: 1448
Location: Chicago, IL

PostPosted: Sat Jan 06, 2007 5:13 am
Reply with quote

ranjitbhingare wrote:
2. FROM EMP TABLE find the employees with Higest Pay, 2nd Higest Pay, 3rd Higest Pay and 4 th Highest Pay ?

SEE PREVIOUS POST
Back to top
View user's profile Send private message
EnjoyMF

New User


Joined: 27 May 2005
Posts: 88

PostPosted: Sun Jan 21, 2007 10:55 am
Reply with quote

HI priyesh.agrawal

But how to find the table names when there is a dead lock.

please tell me whether we can check using SPUFI, QMF


regards
Prasad
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> Mainframe Interview Questions

 


Similar Topics
Topic Forum Replies
No new posts DB2 deadlock DB2 2
No new posts -913/-911 Deadlock during UPDATE stat... DB2 5
No new posts Can a select query participate in a d... DB2 1
No new posts Related to Deadlock issue DB2 2
No new posts table scan can cause deadlock over RID? DB2 10
Search our Forums:

Back to Top