Handling ShardTransaction Failure Scenarios
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / main / java / org / opendaylight / controller / cluster / datastore / ShardReadWriteTransaction.java
index 6733bcfb9f6e323be99a849195bddac637f11588..92fb39308357cd63acf2d7810a321b1081b3ace1 100644 (file)
@@ -65,4 +65,13 @@ public class ShardReadWriteTransaction extends ShardTransaction {
     getSender().tell(new CloseTransactionReply().toSerializable(), getSelf());
     getSelf().tell(PoisonPill.getInstance(), getSelf());
   }
+
+    /**
+     * The following method is used in unit testing only
+     * hence the default scope.
+     * This is done to test out failure cases.
+     */
+    public void forUnitTestOnlyExplicitTransactionClose() {
+        transaction.close();
+    }
 }