From 300061a2291b8058f5495a6d50887032c470f524 Mon Sep 17 00:00:00 2001 From: "gu.martinm@gmail.com" Date: Fri, 10 Oct 2014 19:32:29 +0200 Subject: [PATCH] Data base deadlocks. How to deal with them (retries) --- .../java/de/example/sql/deadlocks/example/FirstTransaction.java | 2 -- .../java/de/example/sql/deadlocks/example/SecondTransaction.java | 9 --------- 2 files changed, 11 deletions(-) diff --git a/SpringJava/DeadLocksSQL/src/main/java/de/example/sql/deadlocks/example/FirstTransaction.java b/SpringJava/DeadLocksSQL/src/main/java/de/example/sql/deadlocks/example/FirstTransaction.java index 23d72a5..5370788 100644 --- a/SpringJava/DeadLocksSQL/src/main/java/de/example/sql/deadlocks/example/FirstTransaction.java +++ b/SpringJava/DeadLocksSQL/src/main/java/de/example/sql/deadlocks/example/FirstTransaction.java @@ -49,8 +49,6 @@ public class FirstTransaction { } this.trx1Gate.close(); - trx2Gate.open(); - this.doThirdStep(); logger.info("End doFirstStepWithGate"); diff --git a/SpringJava/DeadLocksSQL/src/main/java/de/example/sql/deadlocks/example/SecondTransaction.java b/SpringJava/DeadLocksSQL/src/main/java/de/example/sql/deadlocks/example/SecondTransaction.java index 2dd9631..1d059f2 100644 --- a/SpringJava/DeadLocksSQL/src/main/java/de/example/sql/deadlocks/example/SecondTransaction.java +++ b/SpringJava/DeadLocksSQL/src/main/java/de/example/sql/deadlocks/example/SecondTransaction.java @@ -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"); -- 2.1.4