Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

What is a deadlock in DB2

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe Interview Questions
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    Post subject: What is a deadlock in DB2
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

Site Director


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

PostPosted: Fri Jan 05, 2007 11:26 pm    Post subject:
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: 1452
Location: Chicago, IL

PostPosted: Sat Jan 06, 2007 5:13 am    Post subject: Re: DB2 Interview question
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    Post subject: Re: What is a deadlock in DB2
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    IBMMAINFRAMES.com Support Forums -> Mainframe Interview Questions All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts -913/-911 Deadlock during UPDATE stat... NoSleep319 DB2 5 Fri Nov 18, 2016 12:37 am
No new posts Can a select query participate in a d... apvardhini DB2 1 Fri May 29, 2015 12:39 pm
No new posts Related to Deadlock issue sivareddy123 DB2 2 Fri Jan 30, 2015 3:59 pm
No new posts table scan can cause deadlock over RID? dejunzhu DB2 10 Fri Jul 04, 2014 8:36 am
No new posts Creating IDMS Deadlock seahawk789 IDMS/ADSO 1 Fri Apr 11, 2014 5:47 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us