The size of the collection is checked before we allocate
the transaction, hence conditional commit does not make sense.
Change-Id: Iada5db72f2fcf51528c8b1791f2b5ae9d7f51c6a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
ReadWriteTransaction opTx = dataBroker.newReadWriteTransaction();
- int numRemoved = deletedDevices.size();
-
for (InstanceIdentifier<?> removedIID : deletedDevices) {
LOG.info("Deleting the entry for callhome device {}", removedIID);
opTx.delete(LogicalDatastoreType.OPERATIONAL, removedIID);
}
- if (numRemoved > 0) {
- opTx.commit();
- }
+ opTx.commit();
}
private static List<Device> getReadDevices(final ListenableFuture<Optional<AllowedDevices>> devicesFuture)