Before we close the DTCL we must make sure we flush all changes,
otherwise we could end up losing changes simply because we are no
longer interested in them.
JIRA: MDSAL-429
Change-Id: I6df384c375ea1692a10c9f460d3dceb626468061
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
execute(write);
if (registration != null) {
+ // DCL is asynchronous, we need to make sure all tasks are executed before we close the registration,
+ // otherwise they would get lost
+ dclExecutorService.shutdown();
+ dclExecutorService.awaitTermination(5, TimeUnit.SECONDS);
registration.close();
}