aboutsummaryrefslogtreecommitdiff
path: root/id
diff options
context:
space:
mode:
Diffstat (limited to 'id')
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/process/dao/ProcessInstanceStore.java3
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/process/dao/ProcessInstanceStoreDAOImpl.java20
2 files changed, 15 insertions, 8 deletions
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/process/dao/ProcessInstanceStore.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/process/dao/ProcessInstanceStore.java
index 010f8d984..625199cd2 100644
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/process/dao/ProcessInstanceStore.java
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/process/dao/ProcessInstanceStore.java
@@ -1,6 +1,7 @@
package at.gv.egovernment.moa.id.process.dao;
import java.io.Serializable;
+import java.util.HashMap;
import java.util.Map;
import javax.persistence.Column;
@@ -39,7 +40,7 @@ public class ProcessInstanceStore {
@Column(name = "executionContextData", nullable = false)
@Lob
@ElementCollection(fetch=FetchType.EAGER)
- private Map<String, Serializable> executionContextData;
+ private Map<String, Serializable> executionContextData = new HashMap<>();
public String getProcessInstanceId() {
return processInstanceId;
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/process/dao/ProcessInstanceStoreDAOImpl.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/process/dao/ProcessInstanceStoreDAOImpl.java
index e9e977d53..0a50afc6c 100644
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/process/dao/ProcessInstanceStoreDAOImpl.java
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/process/dao/ProcessInstanceStoreDAOImpl.java
@@ -67,6 +67,11 @@ public class ProcessInstanceStoreDAOImpl implements ProcessInstanceStoreDAO {
MOASessionDBUtils.closeSession();
}
}
+ if (result != null) {
+ log.debug("Found process instance store for instance '{}'.", processInstanceId);
+ } else {
+ log.debug("Unable to find process instance store for instance '{}'.", processInstanceId);
+ }
return result;
}
@@ -74,14 +79,15 @@ public class ProcessInstanceStoreDAOImpl implements ProcessInstanceStoreDAO {
public void remove(String processInstanceId) throws MOADatabaseException {
log.debug("Delete the ProcessInstanceStore for id='{}' from the database.", processInstanceId);
-
ProcessInstanceStore toBeDeleted = load(processInstanceId);
- boolean deleted = MOASessionDBUtils.delete(toBeDeleted);
- if (!deleted) {
- log.warn("Could not delete the ProcessInstanceStore with process instance id '{}'", processInstanceId);
- throw new MOADatabaseException("Could not delete the ProcessInstanceStore with process instance id '"
- + processInstanceId + "'.");
- }
+ if (toBeDeleted != null) {
+ if (!MOASessionDBUtils.delete(toBeDeleted)) {
+ log.warn("Could not delete the ProcessInstanceStore with process instance id '{}'", processInstanceId);
+ throw new MOADatabaseException("Could not delete the ProcessInstanceStore with process instance id '"
+ + processInstanceId + "'.");
+ }
+ } else
+ log.trace("ProcessInstanceStore for id='{}' was not found and could therefore not be deleted.", processInstanceId);
}
}