maxtardiveau
Programmer
We seem to get an awful lot of deadlocks using DB2 7.2 on AIX or Win2K. Here's a scenario to reproduce a simple deadlock. First create a table :
Now open two clients (make sure autocommit is turned off) :
Client 1
Client 2
-- this blocks
Client 1
-- deadlock
I'm very afraid that this is in fact normal and that's just the way DB2 works. Maybe someone can tell me otherwise ? It would be a great relief.
I don't understand why DB2 wants to acquire a lock on row n+1 when it deletes row n.
Any insights greatly appreciated.
Thanks,
-- Max
Code:
create table t1 (a int not null primary key)
insert into t1 (a) values (1)
insert into t1 (a) values (2)
insert into t1 (a) values (3)
commit
Now open two clients (make sure autocommit is turned off) :
Client 1
Code:
delete from t1 where a = 3
Client 2
Code:
delete from t1 where a = 2
Client 1
Code:
delete from t1 where a = 1
I'm very afraid that this is in fact normal and that's just the way DB2 works. Maybe someone can tell me otherwise ? It would be a great relief.
I don't understand why DB2 wants to acquire a lock on row n+1 when it deletes row n.
Any insights greatly appreciated.
Thanks,
-- Max