[ 
http://issues.apache.org/jira/browse/DERBY-214?page=comments#action_63912 ]
     
David Van Couvering commented on DERBY-214:
-------------------------------------------

Hi, Kathey.  I think I can work on this.  Is it OK for NetworkServerControl to 
call System.exit, or does that need to throw an exception as well?

The technique I usually do for a utility that I want callable by another class 
as well as executable from the command line is for the main() routine to 
delegate to another public method which throws exceptions and doesn't call 
System.exit().  Then the main() routine catches any exceptions and calls 
System.exit(1) if there is an exception or System.exit(0) if there isn't one.  
Then classes call the other public method and main() is only used from the 
command-line.

Does that work here?

Thanks,

David

> Remove System.exit() calls from the DB2jServerImpl.java
> -------------------------------------------------------
>
>          Key: DERBY-214
>          URL: http://issues.apache.org/jira/browse/DERBY-214
>      Project: Derby
>         Type: Bug
>   Components: Network Server
>     Versions: 10.1.0.0
>     Reporter: Kathey Marsden

>
> The System.exit() calls needs to be removed from the 
> DB2jServerImpl.java as this results in the entire application 
> (example - Eclipse which is running the Network Server inside 
> it) getting shut down.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira

Reply via email to