Hi!
I'm an Oracle DBA, and I was involved in the
evaluation of various solutions for O/R mapping.
So I came across the Torque, and after some tests
understood, that Torque could be used as a
multi-platform database migration (or distribution)
tool.
An idea is to use a sequences of tasks:
Phase 1 - prepare an XML description of data model and
initial data set:
1. project-jdbc (or project-sql2xml from source DDL
script) to create a data model XML definition
2. project-datadtd to create data definition DTD
3. project-datadump to extract initial dataset from
live database
Phase 2 - to generate a set of scripts for target
database
4. project-sql-no-idtable - create a target DDL script
5. project-datasql - create a target INSERT script.
But some of the steps does not work perfectly:
1. project-jdbc does not work at all. I've got an
error message:
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
BUILD FAILED
C: orqueuild.xml:249: Could not create task of type:
torque-jdbc due to java.
lang.VerifyError: (class:
org/apache/torque/task/TorqueJDBCTransformTask, method
: generateXML signature: ()V) Incompatible object
argument for function call
at
org.apache.tools.ant.Project.createTask(Project.java:509)
at
org.apache.tools.ant.UnknownElement.makeTask(UnknownElement.java:148)
at
org.apache.tools.ant.UnknownElement.maybeConfigure(UnknownElement.jav
a:83)
at
org.apache.tools.ant.Task.perform(Task.java:216)
at
org.apache.tools.ant.Target.execute(Target.java:184)
at
org.apache.tools.ant.Target.performTasks(Target.java:202)
at
org.apache.tools.ant.Project.executeTarget(Project.java:601)
at
org.apache.tools.ant.Project.executeTargets(Project.java:560)
at
org.apache.tools.ant.Main.runBuild(Main.java:454)
at
org.apache.tools.ant.Main.start(Main.java:153)
at
org.apache.tools.ant.Main.main(Main.java:176)
--- Nested Exception ---
java.lang.VerifyError: (class:
org/apache/torque/task/TorqueJDBCTransformTask, m
ethod: generateXML signature: ()V) Incompatible object
argument for function cal
l
at java.lang.Class.newInstance0(Native Method)
at java.lang.Class.newInstance(Class.java:237)
at
org.apache.tools.ant.Project.createTask(Project.java:486)
at
org.apache.tools.ant.UnknownElement.makeTask(UnknownElement.java:148)
at
org.apache.tools.ant.UnknownElement.maybeConfigure(UnknownElement.jav
a:83)
at
org.apache.tools.ant.Task.perform(Task.java:216)
at
org.apache.tools.ant.Target.execute(Target.java:184)
at
org.apache.tools.ant.Target.performTasks(Target.java:202)
at
org.apache.tools.ant.Project.executeTarget(Project.java:601)
at
org.apache.tools.ant.Project.executeTargets(Project.java:560)
at
org.apache.tools.ant.Main.runBuild(Main.java:454)
at
org.apache.tools.ant.Main.start(Main.java:153)
at
org.apache.tools.ant.Main.main(Main.java:176)
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
The project-sql2xml (using a sample of Oracle DDL
script) have two problems:
- it converted all numeric (or NUMBER) type fields to
VARCHAR type
- it added an attribute "javaName" that not recognised
by project-sql-no-idtable task
3. project-datadump - it can not recognise a NULL
value in the database field, and fills it with the
value from previous field
4. project-sql-no-idtable - it does not recognize that
the default value SYSDATE in the DATE columns is a
function, not a literal string (using this function as
a default is very popular in Oracle world)
5. project-datasql - does not work, got an error:
>>>>>>>>>>>>>>>>>>>>>>>
BUILD FAILED
C: orqueuild.xml:286: Generation failed. For more
information consult the vel
ocity log, or invoke ant with the -debug flag.
at
org.apache.velocity.texen.ant.TexenTask.execute(TexenTask.java:579)
at
org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:104)
at
org.apache.tools.ant.Task.perform(Task.java:217)
at
org.apache.tools.ant.Target.execute(Target.java:184)
at
org.apache.tools.ant.Target.performTasks(Target.java:202)
at
org.apache.tools.ant.Project.executeTarget(Project.java:601)
at
org.apache.tools.ant.Project.executeTargets(Project.java:560)
at
org.apache.tools.ant.Main.runBuild(Main.java:454)
at
org.apache.tools.ant.Main.start(Main.java:153)
at
org.apache.tools.ant.Main.main(Main.java:176)
--- Nested Exception ---
java.lang.Exception: Exception parsing data XML:
at
org.apache.torque.task.TorqueDataSQLTask.initControlContext(TorqueDat
aSQLTask.java:169)
at
org.apache.velocity.texen.ant.TexenTask.execute(TexenTask.java:480)
at
org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:104)
at
org.apache.tools.ant.Task.perform(Task.java:217)
at
org.apache.tools.ant.Target.execute(Target.java:184)
at
org.apache.tools.ant.Target.performTasks(Target.java:202)
at
org.apache.tools.ant.Project.executeTarget(Project.java:601)
at
org.apache.tools.ant.Project.executeTargets(Project.java:560)
at
org.apache.tools.ant.Main.runBuild(Main.java:454)
at
org.apache.tools.ant.Main.start(Main.java:153)
at
org.apache.tools.ant.Main.main(Main.java:176)
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Environment:
- Windows2000 Professional
- JDK 1.3.1_02
- Ant 1.4.1
- Torque 3.0.1b
- Oracle 9i
- MySQL 4.0.1 alpha
Thanks a lot, I'll appreciate any feedback from you.
Sergei Pohilko
__________________________________________________
Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax
http://taxes.yahoo.com/
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>