Fixed issue 20630. Maintenance flag will only be set if update.database finished correctly.
authorAntonio Moreno <antonio.moreno@openbravo.com>
Tue, 29 May 2012 12:30:40 +0200
changeset 16688 b87d6a90f2db
parent 16687 5e3ad075603e
child 16689 faec5225c28a
Fixed issue 20630. Maintenance flag will only be set if update.database finished correctly.
build.xml
--- a/build.xml	Tue May 29 12:00:37 2012 +0200
+++ b/build.xml	Tue May 29 12:30:40 2012 +0200
@@ -325,6 +325,19 @@
      </sequential>
   </macrodef>
   
+  <macrodef name="updatesystemstatuswhennot">
+    <attribute name="v" default="NOT SET"/>
+    <attribute name="previous" default="NOT SET"/>
+     <sequential>
+       <sql driver="${bbdd.driver}" url="${bbdd.owner.url}" userid="${bbdd.user}" password="${bbdd.password}" onerror="continue" autocommit="true">
+         <classpath> <fileset dir="${base.lib}"> <include name="**/*.jar"> </include> </fileset> </classpath>
+         <transaction> UPDATE ad_system_info SET system_status='@{v}' where system_status!='@{previous}' ;
+                       DELETE FROM ad_error_log where system_status=(select system_status from ad_system_info)
+         </transaction>
+       </sql>
+     </sequential>
+  </macrodef>
+  
   <taskdef resource="axis-tasks.properties" classpathref="project.class.path" />
   
   <target name="init" depends="code.rev">
@@ -383,7 +396,7 @@
 
     <ant dir="${base.db}" target="setApplied" inheritAll="true" inheritRefs="true" />
     <antcall target="build.deploy" />
-    <updatesystemstatus v="RB51"/>
+    <updatesystemstatuswhennot v="RB51" previous="RB12"/>
     <!-- only restart tomcat if the restart prop was set to true -->
     <condition property="dorestart">
       <istrue value="${restart}" />