diff --git a/src/org/gcube/dataanalysis/ecoengine/processing/LocalSplitGenerator.java b/src/org/gcube/dataanalysis/ecoengine/processing/LocalSplitGenerator.java index bc2aa2c..f671aaf 100644 --- a/src/org/gcube/dataanalysis/ecoengine/processing/LocalSplitGenerator.java +++ b/src/org/gcube/dataanalysis/ecoengine/processing/LocalSplitGenerator.java @@ -198,13 +198,6 @@ public class LocalSplitGenerator implements Generator { public void shutdown() { // shutdown threads executorService.shutdown(); - if (writerScheduler != null) { - try { - writerScheduler.cancel(); -// writerScheduler.purge(); - } catch (Exception e) { - } - } // shutdown connection stopInterrupt = true; if (!distributionModel.isSynchronousProbabilityWrite()) { @@ -215,8 +208,17 @@ public class LocalSplitGenerator implements Generator { } } } + + if (writerScheduler != null) { + try { + writerScheduler.cancel(); + writerScheduler.purge(); + } catch (Exception e) { + } + } AnalysisLogger.getLogger().trace("CLOSING CONNECTIONS"); dbHibConnection.close(); + } @Override