Local communication working
[iotcloud.git] / version2 / src / java / iotcloud / Transaction.java
index b3a04900e41ff6cb2a6f8cc1ab482c2b8bbfc052..f444ded5f8c294106e18914af138c6461f777250 100644 (file)
@@ -28,6 +28,8 @@ class Transaction {
 
     private TransactionStatus transactionStatus = null;
 
+    private boolean hadServerFailure = false;
+
     public Transaction() {
         parts = new HashMap<Integer, TransactionPart>();
         keyValueGuardSet = new HashSet<KeyValue>();
@@ -142,6 +144,21 @@ class Transaction {
         return part;
     }
 
+
+    public void setServerFailure() {
+        hadServerFailure = true;
+    }
+
+    public boolean getServerFailure() {
+        return hadServerFailure;
+    }
+
+
+    public void resetServerFailure() {
+        hadServerFailure = false;
+    }
+
+
     public void setTransactionStatus(TransactionStatus _transactionStatus) {
         transactionStatus = _transactionStatus;
     }
@@ -268,10 +285,19 @@ class Transaction {
 
             if (kvGuard.getValue() != null) {
                 if ((kv == null) || (!kvGuard.getValue().equals(kv.getValue()))) {
+
+
+                    if (kv != null) {
+                        System.out.println(kvGuard.getValue() + "       " + kv.getValue());
+                    } else {
+                        System.out.println(kvGuard.getValue() + "       " + kv);
+                    }
+
                     return false;
                 }
             } else {
                 if (kv != null) {
+                    System.out.println("kvGuard was nulled:  " + kv);
                     return false;
                 }
             }