Issue Type: Bug Bug
Affects Versions: 1.5
Assignee: Unassigned
Created: 18/Sep/12 4:02 AM
Description:

When I make a syntax error on purpose, the execution of the script is terminated and the specific error is given.

But when an INSERT statement leads to a FOREIGH KEY constraint violation, the rest of the script file is ignored but no error is given and the execution of the plugin is not terminated.

<plugin>
    <!-- See http://mojo.codehaus.org/sql-maven-plugin/execute-mojo.html -->
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>sql-maven-plugin</artifactId>
    <version>1.5</version>
    <inherited>false</inherited>
    <dependencies>
	<dependency>
	    <groupId>com.microsoft</groupId>					     
            <artifactId>sqljdbc4</artifactId>
	    <version>${microsoft.jdbc.version}</version>
	</dependency>
    </dependencies>
    <executions>					
	<execution>
            <id>create-test-db</id>
	    <phase>process-test-resources</phase>
	    <goals>
	        <goal>execute</goal>
	    </goals>
	    <configuration>
		<username>${db.user}</username>
		<password>${db.password}</password>
		<settingsKeys>sensibleKey</settingsKeys>
	        <driver>com.microsoft.sqlserver.jdbc.SQLServerDriver</driver>
	        <url>jdbc:sqlserver://${db.servername}:${db.portnumber};database=${db.databasename}</url>
		<srcFiles>					       
                    <srcFile>sql_scripts/domain/drop_constraints.sql</srcFile>	
                    <srcFile>sql_scripts/domain/drop_tables.sql</srcFile>	  
                    <srcFile>sql_scripts/domain/drop_functions.sql</srcFile>
                    <srcFile>sql_scripts/domain/create_functions.sql</srcFile>							
                    <srcFile>sql_scripts/domain/create_tables.sql</srcFile>
                    <srcFile>sql_scripts/domain/create_constraints.sql</srcFile>						              
                </srcFiles>				       
                <forceMojoExecution>true</forceMojoExecution>
	    </configuration>
	</execution>					
        <execution>
	    <id>create-domain-db</id>
	    <phase>install</phase>
	    <goals>						
                <goal>execute</goal>
	    </goals>
	    <configuration>
	        <username>${db.user}</username>
		<password>${db.password}</password>
		<settingsKeys>sensibleKey</settingsKeys>
	        <driver>com.microsoft.sqlserver.jdbc.SQLServerDriver</driver>
                <url>jdbc:sqlserver://${db.servername}:${db.portnumber};database=${db.domain.databasename}</url>
	        <srcFiles>
	            <srcFile>sql_scripts/domain/drop_constraints.sql</srcFile>								
                    <srcFile>sql_scripts/domain/drop_tables.sql</srcFile>
	            <srcFile>sql_scripts/domain/drop_functions.sql</srcFile>
		    <srcFile>sql_scripts/domain/create_functions.sql</srcFile>
		    <srcFile>sql_scripts/domain/create_tables.sql</srcFile>
	            <srcFile>sql_scripts/domain/create_constraints.sql</srcFile>
	            <srcFile>sql_scripts/domain/insert_reference_keuzeopties.sql</srcFile>
	            <srcFile>sql_scripts/domain/insert_reference_keuzeopties_test_data.sql</srcFile>
	            <srcFile>sql_scripts/domain/insert_reference_data.sql</srcFile>
	            <srcFile>sql_scripts/domain/insert_reference_templates.sql</srcFile>
	            <srcFile>sql_scripts/domain/insert_reference_development_test_data.sql</srcFile>
	        </srcFiles>
		<forceMojoExecution>true</forceMojoExecution>
	    </configuration>
	</execution>
        ...

If one of the insert_reference_data SQL scripts has a FOREIGN KEY conflict, the script itself will terminate (without error), but the rest of the scripts will continue.


Can this be changed that if any SQL error occurs, execution should be aborted?

Project: Maven 2.x SQL Plugin
Priority: Major Major
Reporter: Steve Schols
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira
--------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email

Reply via email to