我在下面看到在oracle 12g跟蹤文件中檢測到的死鎖的詳細信息,但我不明白爲什麼在這裏發生死鎖?死鎖的根本原因?
死鎖發生時線程1所獲取鎖定表1和錶行,而是要等待表2行,並在同一時間線程2所獲取鎖定表2行BYT等待table1的行
但我沒有看到詳細說明哪個會話獲得哪個表上的鎖並等待哪個資源。任何幫助什麼是在這裏鎖定的對象和 它的原因?
Deadlock graph:
---------Blocker(s)-------- ---------Waiter(s)---------
Resource Name process session holds waits process session holds waits
TX-00290010-00015F75-00000000-00000000 295 1200 X 288 10 X
TX-00570012-00005D9B-00000000-00000000 288 10 X 295 1200 X
session 1200: DID 0001-0127-00014421 session 10: DID 0001-0120-00016BD1
session 10: DID 0001-0120-00016BD1 session 1200: DID 0001-0127-00014421
Rows waited on:
Session 1200: obj - rowid = 00051348 - BABRNIAARAAKfNLAAl
...
Session 10: obj - rowid = 000514F2 - BABRTyAAJAAKWbIAAY
....
----- Information for the OTHER waiting sessions -----
....
current SQL:
update employee set name=:1
----- End of information for the OTHER waiting sessions -----
Information for THIS session:
----- Current SQL Statement for this session (sql_id=5dfr2prw60rh1) -----
update department set address =:1 where id=:1
===================================================
你是在說2更新導致更新?如果你停止了一次更新,是否會離開鎖? – Moudiz
請在這裏發佈'employee'和'department'表的完整DDL。 – nop77svk