Eli Mesika has uploaded a new change for review.

Change subject: core: Could not clear external job
......................................................................

core: Could not clear external job

This patch fixes two problems when attempting to clear and external job
from the API

1) The parameters in the UpdateJob SP did not match the parameters sent
from the DAO
2) The command did not set the return value when succeeded, causing the
whole command to rollback

Change-Id: Ie838897d389ad9bf253cfe3edc8a363f73d584bb
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1156055
Signed-off-by: emesika <[email protected]>
---
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/ClearExternalJobCommand.java
M packaging/dbscripts/job_sp.sql
2 files changed, 7 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/64/38664/1

diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/ClearExternalJobCommand.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/ClearExternalJobCommand.java
index 34e0518..7a078c2 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/ClearExternalJobCommand.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/ClearExternalJobCommand.java
@@ -50,7 +50,7 @@
         job = getJobDao().get((Guid) getParameters().getJobId());
         job.setAutoCleared(true);
         getJobDao().update(job);
-
+        setSucceeded(true);
     }
 
     @Override
diff --git a/packaging/dbscripts/job_sp.sql b/packaging/dbscripts/job_sp.sql
index 9856d77..96cb37e 100644
--- a/packaging/dbscripts/job_sp.sql
+++ b/packaging/dbscripts/job_sp.sql
@@ -120,7 +120,9 @@
     v_start_time TIMESTAMP WITH TIME ZONE,
     v_end_time TIMESTAMP WITH TIME ZONE,
     v_last_update_time TIMESTAMP WITH TIME ZONE,
-    v_correlation_id VARCHAR(50))
+    v_correlation_id VARCHAR(50),
+    v_is_external boolean,
+    v_is_auto_cleared boolean)
 RETURNS VOID
 AS $procedure$
 BEGIN
@@ -133,7 +135,9 @@
         start_time = v_start_time,
         end_time = v_end_time,
         last_update_time = v_last_update_time,
-        correlation_id = v_correlation_id
+        correlation_id = v_correlation_id,
+        is_external = v_is_external,
+        is_auto_cleared = v_is_auto_cleared
     WHERE job_id = v_job_id;
 END; $procedure$
 LANGUAGE plpgsql;


-- 
To view, visit https://gerrit.ovirt.org/38664
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie838897d389ad9bf253cfe3edc8a363f73d584bb
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Eli Mesika <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to