Data base deadlocks. How to deal with them (retries)
authorgu.martinm@gmail.com <gu.martinm@gmail.com>
Fri, 10 Oct 2014 17:32:29 +0000 (19:32 +0200)
committergu.martinm@gmail.com <gu.martinm@gmail.com>
Fri, 10 Oct 2014 17:32:29 +0000 (19:32 +0200)
SpringJava/DeadLocksSQL/src/main/java/de/example/sql/deadlocks/example/FirstTransaction.java
SpringJava/DeadLocksSQL/src/main/java/de/example/sql/deadlocks/example/SecondTransaction.java

index 23d72a5..5370788 100644 (file)
@@ -49,8 +49,6 @@ public class FirstTransaction {
         }
                this.trx1Gate.close();
 
-               trx2Gate.open();
-
         this.doThirdStep();
 
         logger.info("End doFirstStepWithGate");
index 2dd9631..1d059f2 100644 (file)
@@ -50,15 +50,6 @@ public class SecondTransaction {
            // trx1 continue
            trx1Gate.open();
 
-           try {
-               this.trx2Gate.await();
-           } catch (InterruptedException e) {
-               logger.warn("interrupt error", e);
-
-               Thread.currentThread().interrupt();
-           }
-           this.trx2Gate.close();
-
            this.doFourthStep();
 
         logger.info("End doSecondStepWithGate");