From: Tony Tkacik Date: Wed, 29 Apr 2015 07:04:37 +0000 (+0000) Subject: Merge "BUG 3066 : Optimistic lock failed, on NetconfStateUpdate" into stable/lithium X-Git-Tag: release/lithium~202 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=commitdiff_plain;h=836834b4bdec55222de4843a144c8800e0e02dce;hp=504b62fb7c14248f0435c958646c49358ffde19f;p=controller.git Merge "BUG 3066 : Optimistic lock failed, on NetconfStateUpdate" into stable/lithium --- diff --git a/opendaylight/netconf/mdsal-netconf-monitoring/src/main/java/org/opendaylight/controller/config/yang/netconf/mdsal/monitoring/MonitoringToMdsalWriter.java b/opendaylight/netconf/mdsal-netconf-monitoring/src/main/java/org/opendaylight/controller/config/yang/netconf/mdsal/monitoring/MonitoringToMdsalWriter.java index 50958e423f..3dbcc53822 100644 --- a/opendaylight/netconf/mdsal-netconf-monitoring/src/main/java/org/opendaylight/controller/config/yang/netconf/mdsal/monitoring/MonitoringToMdsalWriter.java +++ b/opendaylight/netconf/mdsal-netconf-monitoring/src/main/java/org/opendaylight/controller/config/yang/netconf/mdsal/monitoring/MonitoringToMdsalWriter.java @@ -61,19 +61,12 @@ final class MonitoringToMdsalWriter implements AutoCloseable, NetconfMonitoringS tx.put(LogicalDatastoreType.OPERATIONAL, InstanceIdentifier.create(NetconfState.class), state); // FIXME first attempt (right after we register to binding broker) always fails // Is it due to the fact that we are writing from the onSessionInitiated callback ? - final CheckedFuture submit = tx.submit(); - - Futures.addCallback(submit, new FutureCallback() { - @Override - public void onSuccess(final Void aVoid) { - LOG.debug("Netconf state updated successfully"); - } - - @Override - public void onFailure(final Throwable throwable) { - LOG.warn("Unable to update netconf state", throwable); - } - }); + try { + tx.submit().checkedGet(); + LOG.debug("Netconf state updated successfully"); + } catch (TransactionCommitFailedException e) { + LOG.warn("Unable to update netconf state", e); + } } @Override