Problem with autocommit in ANT SQL task

Posted by Alex Stamper on Stack Overflow See other posts from Stack Overflow or by Alex Stamper
Published on 2010-06-13T11:31:10Z Indexed on 2010/06/13 11:42 UTC
Read the original article Hit count: 352

Filed under:
|
|
|

I have an SQL script and want to apply it witn ANT task. This script clears out schema, creates new tables and views.

The ANT defined task as follows:

<sql driver="com.mysql.jdbc.Driver"
        url="jdbc:mysql://host:3306/smth"
        userid="smth"
        password="smth"
        expandProperties="false"
        autocommit="true"             
        src="all.sql"
         >
</sql>

When this task launches, it shows in log that tables are cleared and created. But when it tries to create first view, it fails with:

Failed to execute:  CREATE VIEW component... AS SELECT component_raw.id AS
MySQLSyntaxErrorException: Table 'component_raw' doesn't exist

I have no idea why it fails here. Running this all.sql from MySQL query browser gives no errors. When I launched ANT with -v option, I didn't see any "COMMIT" messages..

Please, help to resolve the problem.

© Stack Overflow or respective owner

Related posts about sql

Related posts about ant