Innodb MySQL死锁。如何准确找到原因

Innodb MySQL死锁。如何准确找到原因,innodb,deadlock,Innodb,Deadlock,当I key命令显示引擎INNODB状态时\g;显示状态。我发现有僵局。它表示死锁发生在TaskInfo表中。但是什么是HT_TaskInfo?我没有创建这个表。谁能解释一下到底是什么导致了僵局 ------------------------ LATEST DETECTED DEADLOCK ------------------------ 141009 22:55:13 *** (1) TRANSACTION: TRANSACTION 0 333298183, ACTIVE 1 sec, O

当I key命令显示引擎INNODB状态时\g;显示状态。我发现有僵局。它表示死锁发生在TaskInfo表中。但是什么是HT_TaskInfo?我没有创建这个表。谁能解释一下到底是什么导致了僵局

------------------------
LATEST DETECTED DEADLOCK
------------------------
141009 22:55:13
*** (1) TRANSACTION:
TRANSACTION 0 333298183, ACTIVE 1 sec, OS thread id 5628 starting index read
mysql tables in use 1, locked 1
LOCK WAIT 2 lock struct(s), heap size 368, 1 row lock(s)
MySQL thread id 4591, query id 1071477 10.0.0.4 ptrackUser Updating
update TaskInfo set actualHB='2014-10-09 22:56:00', actualHO='2014-10-09 22:55:05', assignee_username='7438', assigner_username='P0041057', basi
Task_id=19429, clientQualityRequirement=null, confirmscore=0.0, createDate='2014-10-08 10:02:45', creater='7438', deliverables=null, dis_id=null
 hipmStatus=null, instruction=null, isnewHipmTask=0, isrework=0, jobBatch_id=null, ongoing=0, parentTask=41641, plannedHB='2014-10-09 09:00:00',
plannedHO='2014-10-08 10:03:00', reason=null, reworkTaskId=null, score=null, sourceFilePath=null, status=2, subType=0, taskBatch_id=88410, taskC
de=null, type='1', unit='Words', volume=1661.0 where taskId=41878
*** (1) WAITING FOR THIS LOCK TO BE GRANTED:
RECORD LOCKS space id 0 page no 689799 n bits 176 index `PRIMARY` of table `ptrack`.`taskinfo` trx id 0 333298183 lock_mode X locks rec but not
ap waiting
Record lock, heap no 108 PHYSICAL RECORD: n_fields 37; compact format; info bits 0
 0: len 4; hex 8000a396; asc     ;; 1: len 6; hex 000013ddb9f6; asc       ;; 2: len 7; hex 00000634cc0938; asc    4  8;; 3: len 4; hex 00a0cf44;
asc    D;; 4: SQL NULL; 5: len 8; hex 8000125171b34721; asc    Qq G!;; 6: SQL NULL; 7: SQL NULL; 8: SQL NULL; 9: len 8; hex 8000125171b135d0; as
    Qq 5 ;; 10: len 8; hex 8000125171a21bcc; asc    Qq   ;; 11: len 4; hex 80000001; asc     ;; 12: len 1; hex 31; asc 1;; 13: len 5; hex 576f72
473; asc Words;; 14: len 4; hex 37343338; asc 7438;; 15: len 4; hex 80004be5; asc   K ;; 16: SQL NULL; 17: SQL NULL; 18: SQL NULL; 19: len 4; he
 8000a2a9; asc     ;; 20: len 8; hex 5030303431303537; asc P0041057;; 21: SQL NULL; 22: len 4; hex 8001595a; asc   YZ;; 23: len 1; hex 80; asc
; 24: len 8; hex 8000125171a21b95; asc    Qq   ;; 25: len 4; hex 37343338; asc 7438;; 26: len 4; hex 80000000; asc     ;; 27: SQL NULL; 28: SQL
ULL; 29: SQL NULL; 30: len 1; hex 80; asc  ;; 31: SQL NULL; 32: len 1; hex 80; asc  ;; 33: SQL NULL; 34: len 4; hex 00000000; asc     ;; 35: SQL
NULL; 36: SQL NULL;

*** (2) TRANSACTION:
TRANSACTION 0 333298182, ACTIVE 1 sec, OS thread id 5596 fetching rows, thread declared inside InnoDB 419
mysql tables in use 2, locked 2
423 lock struct(s), heap size 47088, 36018 row lock(s), undo log entries 1
MySQL thread id 4589, query id 1071475 10.0.0.4 ptrackUser Sending data
update TaskInfo set hipmStatus='FAIL' where (taskId) IN (select taskId from HT_TaskInfo)
*** (2) HOLDS THE LOCK(S):
RECORD LOCKS space id 0 page no 689799 n bits 176 index `PRIMARY` of table `ptrack`.`taskinfo` trx id 0 333298182 lock mode S locks rec but not
ap
Record lock, heap no 108 PHYSICAL RECORD: n_fields 37; compact format; info bits 0
 0: len 4; hex 8000a396; asc     ;; 1: len 6; hex 000013ddb9f6; asc       ;; 2: len 7; hex 00000634cc0938; asc    4  8;; 3: len 4; hex 00a0cf44;
asc    D;; 4: SQL NULL; 5: len 8; hex 8000125171b34721; asc    Qq G!;; 6: SQL NULL; 7: SQL NULL; 8: SQL NULL; 9: len 8; hex 8000125171b135d0; as
    Qq 5 ;; 10: len 8; hex 8000125171a21bcc; asc    Qq   ;; 11: len 4; hex 80000001; asc     ;; 12: len 1; hex 31; asc 1;; 13: len 5; hex 576f72
473; asc Words;; 14: len 4; hex 37343338; asc 7438;; 15: len 4; hex 80004be5; asc   K ;; 16: SQL NULL; 17: SQL NULL; 18: SQL NULL; 19: len 4; he
 8000a2a9; asc     ;; 20: len 8; hex 5030303431303537; asc P0041057;; 21: SQL NULL; 22: len 4; hex 8001595a; asc   YZ;; 23: len 1; hex 80; asc
; 24: len 8; hex 8000125171a21b95; asc    Qq   ;; 25: len 4; hex 37343338; asc 7438;; 26: len 4; hex 80000000; asc     ;; 27: SQL NULL; 28: SQL
ULL; 29: SQL NULL; 30: len 1; hex 80; asc  ;; 31: SQL NULL; 32: len 1; hex 80; asc  ;; 33: SQL NULL; 34: len 4; hex 00000000; asc     ;; 35: SQL
NULL; 36: SQL NULL;

*** (2) WAITING FOR THIS LOCK TO BE GRANTED:
RECORD LOCKS space id 0 page no 689799 n bits 176 index `PRIMARY` of table `ptrack`.`taskinfo` trx id 0 333298182 lock_mode X waiting
Record lock, heap no 108 PHYSICAL RECORD: n_fields 37; compact format; info bits 0
 0: len 4; hex 8000a396; asc     ;; 1: len 6; hex 000013ddb9f6; asc       ;; 2: len 7; hex 00000634cc0938; asc    4  8;; 3: len 4; hex 00a0cf44;
asc    D;; 4: SQL NULL; 5: len 8; hex 8000125171b34721; asc    Qq G!;; 6: SQL NULL; 7: SQL NULL; 8: SQL NULL; 9: len 8; hex 8000125171b135d0; as
    Qq 5 ;; 10: len 8; hex 8000125171a21bcc; asc    Qq   ;; 11: len 4; hex 80000001; asc     ;; 12: len 1; hex 31; asc 1;; 13: len 5; hex 576f72
473; asc Words;; 14: len 4; hex 37343338; asc 7438;; 15: len 4; hex 80004be5; asc   K ;; 16: SQL NULL; 17: SQL NULL; 18: SQL NULL; 19: len 4; he
 8000a2a9; asc     ;; 20: len 8; hex 5030303431303537; asc P0041057;; 21: SQL NULL; 22: len 4; hex 8001595a; asc   YZ;; 23: len 1; hex 80; asc
; 24: len 8; hex 8000125171a21b95; asc    Qq   ;; 25: len 4; hex 37343338; asc 7438;; 26: len 4; hex 80000000; asc     ;; 27: SQL NULL; 28: SQL
ULL; 29: SQL NULL; 30: len 1; hex 80; asc  ;; 31: SQL NULL; 32: len 1; hex 80; asc  ;; 33: SQL NULL; 34: len 4; hex 00000000; asc     ;; 35: SQL
NULL; 36: SQL NULL;

*** WE ROLL BACK TRANSACTION (1)
看看HT_TaskInfo是由Hibernate创建的一个临时表