How to reproduce this issue in DB2? I already tried the java with oracle multi process but now tried same approach in DB2 with java. I need to reproduce this.

2

There are 2 best solutions below

0
On

To replay for me question Mr.Stavr00 and Mr.Opal

I am using parallel processing ,which means i will start all process at the time using processBuilder concept on java.And also i need to run particular target time for 3 million records.

0
On

You would need two test tables

CREATE TABLE T1 ( c INT);
CREATE TABLE T2 ( c INT);

insert some dummy values in each of then force a deadlock with two threads where transaction-enabled connections (autocommit=false);

thread 1:

statement.executeUpdate("INSERT INTO T2 SELECT * FROM T1");
Thread.sleep(5000);

thread 2:

statement.executeUpdate("INSERT INTO T1 SELECT * FROM T2");
Thread.sleep(5000);