And it throws
java.lang.IllegalStateException: Previous transaction in chain must be ready.
at com.google.common.base.Preconditions.checkState(Preconditions.java:149) ~[na:na]
at org.opendaylight.controller.md.sal.dom.store.impl.InMemoryDOMDataStore$DOMStoreTransactionChainImpl.newReadWriteTransaction
when we reuse the txchain. Fixing it temporarily. Better solution is to get away from this and use DataChangeListener.
Change-Id: Id20abdefc21574dce9ff078f4ce96aa91c390edb
Signed-off-by: Madhu Venugopal <mavenugo@gmail.com>
// Concrete Service that this AbstractServiceInstance represent
private Service service;
// Concrete Service that this AbstractServiceInstance represent
private Service service;
- private BindingTransactionChain txChain;
-
// Process Notification in its own thread
Thread thread = null;
private final BlockingQueue<String> queue = new LinkedBlockingDeque<>();
// Process Notification in its own thread
Thread thread = null;
private final BlockingQueue<String> queue = new LinkedBlockingDeque<>();
if (notificationService != null) {
notificationService.registerNotificationListener(this);
}
if (notificationService != null) {
notificationService.registerNotificationListener(this);
}
- this.txChain = mdsalConsumer.getDataBroker().createTransactionChain(this);
// Never block a Notification thread. Process the notification in its own Thread.
thread = new Thread(this);
// Never block a Notification thread. Process the notification in its own Thread.
thread = new Thread(this);
InstanceIdentifierBuilder<Node> builder = ((InstanceIdentifier<Node>) ref.getValue()).builder();
InstanceIdentifierBuilder<FlowCapableNode> augmentation = builder.augmentation(FlowCapableNode.class);
final InstanceIdentifier<FlowCapableNode> path = augmentation.build();
InstanceIdentifierBuilder<Node> builder = ((InstanceIdentifier<Node>) ref.getValue()).builder();
InstanceIdentifierBuilder<FlowCapableNode> augmentation = builder.augmentation(FlowCapableNode.class);
final InstanceIdentifier<FlowCapableNode> path = augmentation.build();
+ BindingTransactionChain txChain = mdsalConsumer.getDataBroker().createTransactionChain(this);
CheckedFuture readFuture = txChain.newReadWriteTransaction().read(LogicalDatastoreType.OPERATIONAL, path);
Futures.addCallback(readFuture, new FutureCallback<Optional<? extends DataObject>>() {
@Override
CheckedFuture readFuture = txChain.newReadWriteTransaction().read(LogicalDatastoreType.OPERATIONAL, path);
Futures.addCallback(readFuture, new FutureCallback<Optional<? extends DataObject>>() {
@Override