git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@675579 13f79535-47bb-0310-9956-ffa450edef68master
| @@ -52,6 +52,7 @@ Dan Armbrust | |||||
| Daniel Ribagnac | Daniel Ribagnac | ||||
| Daniel Spilker | Daniel Spilker | ||||
| Danno Ferrin | Danno Ferrin | ||||
| Dante Briones | |||||
| Davanum Srinivas | Davanum Srinivas | ||||
| Dave Brondsema | Dave Brondsema | ||||
| Dave Brosius | Dave Brosius | ||||
| @@ -44,6 +44,11 @@ Changes that could break older environments: | |||||
| simultaniously (while within <parallel>, for example). This lock is | simultaniously (while within <parallel>, for example). This lock is | ||||
| no longer in place, messageLogged should be made thread-safe now. | no longer in place, messageLogged should be made thread-safe now. | ||||
| * <sql>'s onError="stop" no longer fails the build if an error | |||||
| occurs, this is the main difference between stop and error and | |||||
| matches what the documentation implied. | |||||
| Bugzilla Report 24668. | |||||
| Fixed bugs: | Fixed bugs: | ||||
| ----------- | ----------- | ||||
| @@ -231,6 +231,10 @@ | |||||
| <first>Danno</first> | <first>Danno</first> | ||||
| <last>Ferrin</last> | <last>Ferrin</last> | ||||
| </name> | </name> | ||||
| <name> | |||||
| <first>Dante</first> | |||||
| <last>Briones</last> | |||||
| </name> | |||||
| <name> | <name> | ||||
| <first>Davanum</first> | <first>Davanum</first> | ||||
| <last>Srinivas</last> | <last>Srinivas</last> | ||||
| @@ -40,7 +40,7 @@ statements will all be executed as one transaction.</p> | |||||
| <p>The <i>onerror</i> attribute specifies how to proceed when an error occurs | <p>The <i>onerror</i> attribute specifies how to proceed when an error occurs | ||||
| during the execution of one of the statements. | during the execution of one of the statements. | ||||
| The possible values are: <b>continue</b> execution, only show the error; | The possible values are: <b>continue</b> execution, only show the error; | ||||
| <b>stop</b> execution and commit transaction; | |||||
| <b>stop</b> execution, log the error but don't fail the task | |||||
| and <b>abort</b> execution and transaction and fail task.</p> | and <b>abort</b> execution and transaction and fail task.</p> | ||||
| <p> | <p> | ||||
| @@ -466,10 +466,14 @@ public class SQLExec extends JDBCTask { | |||||
| } | } | ||||
| } catch (IOException e) { | } catch (IOException e) { | ||||
| closeQuietly(); | closeQuietly(); | ||||
| throw new BuildException(e, getLocation()); | |||||
| if (onError.equals("abort")) { | |||||
| throw new BuildException(e, getLocation()); | |||||
| } | |||||
| } catch (SQLException e) { | } catch (SQLException e) { | ||||
| closeQuietly(); | closeQuietly(); | ||||
| throw new BuildException(e, getLocation()); | |||||
| if (onError.equals("abort")) { | |||||
| throw new BuildException(e, getLocation()); | |||||
| } | |||||
| } finally { | } finally { | ||||
| try { | try { | ||||
| if (statement != null) { | if (statement != null) { | ||||
| @@ -603,10 +607,12 @@ public class SQLExec extends JDBCTask { | |||||
| goodSql++; | goodSql++; | ||||
| } catch (SQLException e) { | } catch (SQLException e) { | ||||
| log("Failed to execute: " + sql, Project.MSG_ERR); | log("Failed to execute: " + sql, Project.MSG_ERR); | ||||
| if (!onError.equals("abort")) { | |||||
| log(e.toString(), Project.MSG_ERR); | |||||
| } | |||||
| if (!onError.equals("continue")) { | if (!onError.equals("continue")) { | ||||
| throw e; | throw e; | ||||
| } | } | ||||
| log(e.toString(), Project.MSG_ERR); | |||||
| } finally { | } finally { | ||||
| if (resultSet != null) { | if (resultSet != null) { | ||||
| try { | try { | ||||