AMBARI-19712. Cluster creation fails due to database exception. (Attila Doroszlai via stoader)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/cc9c9281 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/cc9c9281 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/cc9c9281 Branch: refs/heads/branch-dev-patch-upgrade Commit: cc9c92811b7371e73393dc7ba5099ea44a1959d8 Parents: e7e4cb2 Author: Attila Doroszlai <adorosz...@hortonworks.com> Authored: Thu Jan 26 19:00:25 2017 +0100 Committer: Toader, Sebastian <stoa...@hortonworks.com> Committed: Thu Jan 26 19:00:25 2017 +0100 ---------------------------------------------------------------------- .../ambari/server/controller/AmbariManagementControllerImpl.java | 1 + .../java/org/apache/ambari/server/state/ServiceComponentImpl.java | 1 + 2 files changed, 2 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/cc9c9281/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java index 0b3869b..0fce72b 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java @@ -1448,6 +1448,7 @@ public class AmbariManagementControllerImpl implements AmbariManagementControlle } @Override + @Transactional public synchronized RequestStatusResponse updateClusters(Set<ClusterRequest> requests, Map<String, String> requestProperties) throws AmbariException, AuthorizationException { http://git-wip-us.apache.org/repos/asf/ambari/blob/cc9c9281/ambari-server/src/main/java/org/apache/ambari/server/state/ServiceComponentImpl.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/ServiceComponentImpl.java b/ambari-server/src/main/java/org/apache/ambari/server/state/ServiceComponentImpl.java index 236091b..cbf0ff9 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/state/ServiceComponentImpl.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/state/ServiceComponentImpl.java @@ -466,6 +466,7 @@ public class ServiceComponentImpl implements ServiceComponent { desiredStateEntity.setClusterServiceEntity(serviceEntity); serviceComponentDesiredStateDAO.create(desiredStateEntity); + serviceEntity.getServiceComponentDesiredStateEntities().add(desiredStateEntity); serviceEntity = clusterServiceDAO.merge(serviceEntity); }