If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > deadlock

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-05-05, 13:53
dba_udb dba_udb is offline
Registered User
 
Join Date: Mar 2005
Posts: 73
Arrow deadlock

UDB V8.2
OS : AIX

I have got this particular query ,,which is failing with deadlock error.
"delete from xxxy where policeis null and logon not in (select logon from emp"

DB21034E The command was processed as an SQL statement because it was not a
valid Command Line Processor command. During SQL processing it returned:
SQL0911N The current transaction has been rolled back because of a deadlock
or timeout. Reason code "2". SQLSTATE=40001

there is no other thred which is using this particular table.
I see other statements with the same table name but a different table name in subselect is executing.

what could be the reason for failure?
Reply With Quote
  #2 (permalink)  
Old 10-05-05, 17:34
chavadb2 chavadb2 is offline
Registered User
 
Join Date: Aug 2004
Posts: 138
get snapshot for locks while you run this statement..it explains who is waiting , who is locking
db2 'reset monitor all'
db2 'update monitor switches .....'
db2 'get snapshor for locks on dbname'
Reply With Quote
  #3 (permalink)  
Old 10-05-05, 20:56
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,196
Concert the query and sub-query to where not exists (select ...
__________________
M. A. Feldman
IBM Certified DBA on DB2 for Linux, UNIX, and Windows
IBM Certified DBA on DB2 for z/OS and OS/390
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On