syncope-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ilgro...@apache.org
Subject [1/3] syncope git commit: During PropagationTask execution, in case the task has to be saved, ensure that the resource instance is refreshed, as it might have been read from another thread
Date Wed, 13 Sep 2017 13:07:11 GMT
Repository: syncope
Updated Branches:
  refs/heads/2_0_X 71010b75d -> d02621b32
  refs/heads/master 43518e5cd -> 2143809ef


During PropagationTask execution, in case the task has to be saved, ensure that the resource
instance is refreshed, as it might have been read from another thread


Project: http://git-wip-us.apache.org/repos/asf/syncope/repo
Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/d02621b3
Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/d02621b3
Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/d02621b3

Branch: refs/heads/2_0_X
Commit: d02621b324a1eeafdccc865afd083bd0583326d2
Parents: 71010b7
Author: Francesco Chicchiriccò <ilgrosso@apache.org>
Authored: Wed Sep 13 15:01:44 2017 +0200
Committer: Francesco Chicchiriccò <ilgrosso@apache.org>
Committed: Wed Sep 13 15:01:44 2017 +0200

----------------------------------------------------------------------
 .../java/propagation/AbstractPropagationTaskExecutor.java     | 7 +++++++
 1 file changed, 7 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/syncope/blob/d02621b3/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/propagation/AbstractPropagationTaskExecutor.java
----------------------------------------------------------------------
diff --git a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/propagation/AbstractPropagationTaskExecutor.java
b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/propagation/AbstractPropagationTaskExecutor.java
index 02bb8b7..3e97682 100644
--- a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/propagation/AbstractPropagationTaskExecutor.java
+++ b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/propagation/AbstractPropagationTaskExecutor.java
@@ -51,6 +51,7 @@ import org.apache.syncope.core.spring.ApplicationContextProvider;
 import org.apache.syncope.core.provisioning.java.utils.ConnObjectUtils;
 import org.apache.syncope.core.provisioning.api.utils.ExceptionUtils2;
 import org.apache.syncope.core.persistence.api.dao.AnyObjectDAO;
+import org.apache.syncope.core.persistence.api.dao.ExternalResourceDAO;
 import org.apache.syncope.core.persistence.api.dao.VirSchemaDAO;
 import org.apache.syncope.core.persistence.api.entity.VirSchema;
 import org.apache.syncope.core.persistence.api.entity.resource.ExternalResource;
@@ -122,6 +123,9 @@ public abstract class AbstractPropagationTaskExecutor implements PropagationTask
     protected TaskDAO taskDAO;
 
     @Autowired
+    protected ExternalResourceDAO resourceDAO;
+
+    @Autowired
     protected VirSchemaDAO virSchemaDAO;
 
     /**
@@ -480,6 +484,9 @@ public abstract class AbstractPropagationTaskExecutor implements PropagationTask
                 execution.setTask(task);
                 task.add(execution);
 
+                // ensure that the resource instance is refreshed, as it might have been
read from another thread
+                task.setResource(resourceDAO.find(task.getResource().getKey()));
+
                 taskDAO.save(task);
                 // needed to generate a value for the execution key
                 taskDAO.flush();


Mime
View raw message