Bug 778768 (SOA-1223) - Schema tool can't be used more than once while changing DB.
Summary: Schema tool can't be used more than once while changing DB.
Keywords:
Status: CLOSED NEXTRELEASE
Alias: SOA-1223
Product: JBoss Enterprise SOA Platform 4
Classification: JBoss
Component: Tooling
Version: 4.3 CP01
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ---
: 4.3 CP02
Assignee: Julian Coleman
QA Contact:
URL: http://jira.jboss.org/jira/browse/SOA...
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-03-12 12:46 UTC by Pavel Macik
Modified: 2009-08-17 07:04 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-08-17 07:04:17 UTC
Type: Bug


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 778883 0 high CLOSED Schema tool can't be used more than once while changing DB. 2021-02-22 00:41:40 UTC
Red Hat Issue Tracker SOA-1223 0 None None None Never

Internal Links: 778883

Description Pavel Macik 2009-03-12 12:46:47 UTC
Date of First Response: 2009-06-24 10:19:15
project_key: SOA

If one use the schema tool for the first time, it works. When db is changed and the schema tool is used again, the schema tool is not aware of the db change it uses old one (db.properties file).

The fix is below (on the /tools/schema/build.xml):
@@ -2,6 +2,14 @@
 <project name="SOA Database Configuration Script" default="execute" basedir=".">
     <property file="build.properties"/>
 
+    <macrodef name="restore">
+        <attribute name="file"/>
+        <sequential>
+            <delete failonerror="false" file="@{file}"/>
+            <copy file="@{file}.orig" tofile="@{file}" overwrite="true"/>
+        </sequential>
+    </macrodef>
+
     <target name="execute" depends="check.profile, ask.profile, exists.profile, check.clustered, check.backup, do.backup">
         <input addproperty="source.dir"
                message="Please enter the database you wish to configure [db2, mssql, mysql, oracle9i, oracle10g, postgresql]:"/>
@@ -129,14 +137,6 @@
             </sequential>
         </macrodef>
 
-        <macrodef name="restore">
-	    <attribute name="file"/>
-	    <sequential>
-		<delete failonerror="false" file="@{file}"/>
-		<copy file="@{file}.orig" tofile="@{file}" overwrite="true"/>
-	    </sequential>
-        </macrodef>
-
         <delete failonerror="false">
             <fileset dir="${target.dir}/deploy">
                 <include name="hsqldb-ds.xml"/>
@@ -370,6 +370,13 @@
 		<copy file="@{file}" tofile="@{file}.orig"/>
 	    </sequential>
         </macrodef>
+        
+        <if>
+            <available file="../console/management-esb/db.properties.orig"/>
+            <then>
+                <restore file="../console/management-esb/db.properties"/>
+            </then>
+        </if>
 
 	<echo message="Backing up files ..."/>
 	<backup file="${target.dir}/deploy/jbossesb.sar/esb.juddi.xml"/>

Comment 1 Pavel Macik 2009-05-21 13:55:04 UTC
Link: Added: This issue related SOA-1325


Comment 2 Julian Coleman 2009-06-24 14:19:15 UTC
Fixed with revision 3208 (4.3 branch) of:
  build-tools/resource/schema/tool/esb/build.xml

Commit message:
  JIRA SOA-1223 

  Split the backup into two parts - one for the configuration directories and
  one for the common directories.  Fixes a bug when the schema tool was used
  with different configurations and should also fix db.properties overwrite
  (SOA-1223).

  Tested by pmacik.


Comment 3 Pavel Macik 2009-08-17 07:04:17 UTC
verified in CR2


Note You need to log in before you can comment on or make changes to this bug.