You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-user@db.apache.org by Michael Hackett <mh...@randomsample.org> on 2006/03/09 07:34:56 UTC
Halting an ij script
Is it possible to halt a script being run by ij on an error? I've been searching for an answer and the closest I came was a post last June that suggested "setting autocommit off" around the SQL and "let the transaction logic take care of things". But I don't get how to stop the commit statement that I expect I'll need at the end of the script from being executed, since ij seems to just keep on going when it hits an error.
Is there way to halt the script and rollback on any error?
Cheers,
-- Michael
Re: Halting an ij script
Posted by Rajesh Kartha <ka...@gmail.com>.
I am not aware of any property that halts 'ij' execution during an
exception. Looking at the code - I think adding some new property like -
Dij.exitOnError=true and implementing that should be simple:
(if you have the Derby source code, refer the method
org.apache.derby.impl.tools.ij.utilMain.handleSQLException() )
Please feel free to file an enchancement in JIRA, if you think such a
property will be a useful for ij.
https://issues.apache.org/jira/browse/DERBY
Also, if you plan to contribute to Derby , there is information available to
get you started at
http://db.apache.org/derby/derby_comm.html#Contribute+Code+or+Documentation
-Rajesh
On 3/8/06, Michael Hackett <mh...@randomsample.org> wrote:
>
> Is it possible to halt a script being run by ij on an error? I've been
> searching for an answer and the closest I came was a post last June that
> suggested "setting autocommit off" around the SQL and "let the transaction
> logic take care of things". But I don't get how to stop the commit statement
> that I expect I'll need at the end of the script from being executed, since
> ij seems to just keep on going when it hits an error.
>
> Is there way to halt the script and rollback on any error?
>
> Cheers,
> -- Michael
>