From ad23d7c1df6b7b2cda6a1d2ecae26c36828b6a85 Mon Sep 17 00:00:00 2001 From: Ralph Soika Date: Wed, 16 May 2018 08:39:17 +0200 Subject: [PATCH] fixed issue #373 --- .../imixs/workflow/engine/DocumentService.java | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/imixs-workflow-engine/src/main/java/org/imixs/workflow/engine/DocumentService.java b/imixs-workflow-engine/src/main/java/org/imixs/workflow/engine/DocumentService.java index 1f5d0537e..b238a23f8 100644 --- a/imixs-workflow-engine/src/main/java/org/imixs/workflow/engine/DocumentService.java +++ b/imixs-workflow-engine/src/main/java/org/imixs/workflow/engine/DocumentService.java @@ -881,7 +881,7 @@ public void backup(String query, String filePath) throws IOException, QueryExcep boolean hasMoreData = true; int JUNK_SIZE = 100; long totalcount = 0; - int startpos = 0; + int pageIndex = 0; int icount = 0; logger.info("backup - starting..."); @@ -898,12 +898,17 @@ public void backup(String query, String filePath) throws IOException, QueryExcep while (hasMoreData) { // read a junk.... - Collection col = find(query, JUNK_SIZE, startpos); + Collection col = find(query, JUNK_SIZE, pageIndex); + totalcount = totalcount + col.size(); + logger.info("backup - processing...... "+col.size() + " documents read...."); - if (col.size() < JUNK_SIZE) + if (col.size() < JUNK_SIZE) { hasMoreData = false; - startpos = startpos + col.size(); - totalcount = totalcount + col.size(); + logger.finest("......all data read."); + } else { + pageIndex++; + logger.finest("......next page..."); + } for (ItemCollection aworkitem : col) { // get serialized data @@ -912,10 +917,9 @@ public void backup(String query, String filePath) throws IOException, QueryExcep out.writeObject(hmap); icount++; } - logger.finest("......"+totalcount + " documents backuped...."); } out.close(); - logger.info("Backup finished - " + icount + " documents read totaly."); + logger.info("backup - finished: " + icount + " documents read totaly."); } /**