Ver código fonte

Revert "AMBARI-12657 - Cluster creates fail on larger deployments with SQL Azure DB (jonathanhurley)"

This reverts commit 91c969ac367abbf0c1c603af084da823d5e52e92.
Jonathan Hurley 10 anos atrás
pai
commit
dcd23a7a76

+ 3 - 3
ambari-server/src/main/java/org/apache/ambari/server/orm/dao/HostRoleCommandDAO.java

@@ -77,7 +77,7 @@ public class HostRoleCommandDAO {
    * SQL template to get all requests which have had all of their tasks
    * COMPLETED
    */
-  private static final String COMPLETED_REQUESTS_SQL = "SELECT DISTINCT task.requestId FROM HostRoleCommandEntity task WHERE task.status NOT IN :notCompletedStatuses ORDER BY task.requestId {0}";
+  private static final String COMPLETED_REQUESTS_SQL = "SELECT DISTINCT task.requestId FROM HostRoleCommandEntity task WHERE NOT EXISTS (SELECT task.requestId FROM HostRoleCommandEntity task WHERE task.status IN :notCompletedStatuses) ORDER BY task.requestId {0}";
 
   @Inject
   Provider<EntityManager> entityManagerProvider;
@@ -383,9 +383,9 @@ public class HostRoleCommandDAO {
 
   @Transactional
   public void removeByHostId(Long hostId) {
-    Collection<HostRoleCommandEntity> commands = findByHostId(hostId);
+    Collection<HostRoleCommandEntity> commands = this.findByHostId(hostId);
     for (HostRoleCommandEntity cmd : commands) {
-      remove(cmd);
+      this.remove(cmd);
     }
   }