BUG-5280: fix a thinko around sealed transactions
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / main / java / org / opendaylight / controller / cluster / databroker / actors / dds / EmptyTransactionCommitCohort.java
index 7032660068319d7f14632f42d9388cccac321f33..7193dd053f762cb37c4cf701afe1efd89fb33919 100644 (file)
@@ -8,21 +8,20 @@
 package org.opendaylight.controller.cluster.databroker.actors.dds;
 
 import com.google.common.util.concurrent.ListenableFuture;
-import org.opendaylight.controller.sal.core.spi.data.DOMStoreThreePhaseCommitCohort;
+import org.opendaylight.controller.cluster.access.concepts.TransactionIdentifier;
 
 /**
  * An {@link AbstractTransactionCommitCohort} for use with empty transactions. This relies on the fact that no backends
  * have been touched, hence all state book-keeping needs to happen only locally and shares fate with the coordinator.
  *
+ * <p>
  * Therefore all methods can finish immediately without any effects.
  *
  * @author Robert Varga
  */
 final class EmptyTransactionCommitCohort extends AbstractTransactionCommitCohort {
-    static final DOMStoreThreePhaseCommitCohort INSTANCE = new EmptyTransactionCommitCohort();
-
-    private EmptyTransactionCommitCohort() {
-        // Hidden
+    EmptyTransactionCommitCohort(final AbstractClientHistory parent, final TransactionIdentifier txId) {
+        super(parent, txId);
     }
 
     @Override
@@ -37,11 +36,13 @@ final class EmptyTransactionCommitCohort extends AbstractTransactionCommitCohort
 
     @Override
     public ListenableFuture<Void> abort() {
+        complete();
         return VOID_FUTURE;
     }
 
     @Override
     public ListenableFuture<Void> commit() {
+        complete();
         return VOID_FUTURE;
     }
 }