X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-distributed-datastore%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Fdatastore%2FAbstractTransactionContextFactory.java;h=df32f8fcaaae4209a566f66781e850b6dfce39de;hp=976e613e8ea183b293d666bc56c8fd8cbc358123;hb=ecccb6d5b43dd73aef0d2d19349d19ee9b4728f7;hpb=9302c5052c431ae2add87d4e14a68570ef7604ec;ds=sidebyside diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/AbstractTransactionContextFactory.java b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/AbstractTransactionContextFactory.java index 976e613e8e..df32f8fcaa 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/AbstractTransactionContextFactory.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/AbstractTransactionContextFactory.java @@ -62,7 +62,7 @@ abstract class AbstractTransactionContextFactory findPrimaryFuture = findPrimaryShard(shardName); if(findPrimaryFuture.isCompleted()) { Try maybe = findPrimaryFuture.value().get(); if(maybe.isSuccess()) { - onFindPrimaryShardSuccess(maybe.get(), parent, shardName, transactionContextAdapter); + onFindPrimaryShardSuccess(maybe.get(), parent, shardName, transactionContextWrapper); } else { - onFindPrimaryShardFailure(maybe.failed().get(), parent, shardName, transactionContextAdapter); + onFindPrimaryShardFailure(maybe.failed().get(), parent, shardName, transactionContextWrapper); } } else { findPrimaryFuture.onComplete(new OnComplete() { @Override public void onComplete(final Throwable failure, final PrimaryShardInfo primaryShardInfo) { if (failure == null) { - onFindPrimaryShardSuccess(primaryShardInfo, parent, shardName, transactionContextAdapter); + onFindPrimaryShardSuccess(primaryShardInfo, parent, shardName, transactionContextWrapper); } else { - onFindPrimaryShardFailure(failure, parent, shardName, transactionContextAdapter); + onFindPrimaryShardFailure(failure, parent, shardName, transactionContextWrapper); } } }, actorContext.getClientDispatcher()); } - return transactionContextAdapter; + return transactionContextWrapper; } private void updateShardInfo(final String shardName, final PrimaryShardInfo primaryShardInfo) { @@ -174,11 +175,13 @@ abstract class AbstractTransactionContextFactory void onTransactionReady(@Nonnull TransactionIdentifier transaction, @Nonnull Collection> cohortFutures); - private static TransactionContext createLocalTransactionContext(final LocalTransactionFactory factory, final TransactionProxy parent) { + private static TransactionContext createLocalTransactionContext(final LocalTransactionFactory factory, + final TransactionProxy parent) { + switch(parent.getType()) { case READ_ONLY: final DOMStoreReadTransaction readOnly = factory.newReadOnlyTransaction(parent.getIdentifier()); - return new LocalTransactionContext(readOnly, parent.getLimiter()) { + return new LocalTransactionContext(readOnly, parent.getIdentifier(), factory) { @Override protected DOMStoreWriteTransaction getWriteDelegate() { throw new UnsupportedOperationException(); @@ -191,7 +194,7 @@ abstract class AbstractTransactionContextFactory