[
https://issues.apache.org/jira/browse/DERBY-5731?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13264743#comment-13264743
]
Knut Anders Hatlen commented on DERBY-5731:
-------------------------------------------
Thanks, Julo. Good points, I agree that a system property would be
useful even if the ij command were implemented.
Adding a parameter to make runScript() fail-fast sounds like a good
alternative to the ij command.
I had a look at the patch, and have a few small comments:
- Looks like you forgot to include ijExitException.java to the patch,
so I'm not able to build with it.
- In utilMain.initFromEnvironment(), converting the property value to
a boolean should be done using Boolean.valueOf() for consistency,
like it's done for ij.showErrorCode a few lines
below. (Boolean.valueOf() is case-insensitive, whereas
String.equals() is not, and it would be good to handle all boolean
properties the same way.)
- Could langUtil and out be changed to parameters of the mainCore()
method? Having them as static variables might cause problems if two
threads invoke ij.main() at the same time. (An unlikely way to
invoke ij, I guess, but since ij.main() is part of the published
API, one never knows how applications use it.)
- Because of Derby's API for shutting down databases, which throws an
exception to signal success, it is quite common for ij scripts to
invoke statements that are expected to fail:
ij> connect 'jdbc:derby:db;shutdown=true';
ERROR 08006: Database 'db' shutdown
ij> connect 'jdbc:derby:;shutdown=true';
ERROR XJ015: Derby system shutdown.
Would it make any sense to add logic to ignore those benign errors?
Or maybe that would just make the property more difficult to
understand, I don't know...
- As to testing, you could probably copy the tools/ij3Test.java test,
modify it to set the new property, and provide a small test script
that fails somewhere in the middle (for example by inserting a
duplicate key into a primary key column, or by executing a statement
with a syntax error).
> It should be possible to start ij in a mode when it terminates in case of any
> error
> -----------------------------------------------------------------------------------
>
> Key: DERBY-5731
> URL: https://issues.apache.org/jira/browse/DERBY-5731
> Project: Derby
> Issue Type: Improvement
> Components: Tools
> Reporter: Julius Stroffek
> Assignee: Julius Stroffek
> Labels: ij
> Attachments: derby-5731.diff
>
>
> It should be possible to determine from the exit status of ij whether the
> commands that were executed failed or not. This should not be the default
> behavior as it will break the compatibility.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira