You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by "Rick Hillegas (JIRA)" <ji...@apache.org> on 2013/04/11 18:51:15 UTC

[jira] [Commented] (DERBY-586) Provide an alternative means to shut down a database other than using getConnection()

    [ https://issues.apache.org/jira/browse/DERBY-586?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13629099#comment-13629099 ] 

Rick Hillegas commented on DERBY-586:
-------------------------------------

Here is a proposal for a shutdown api which does not involve overloading JDBC connections:


We could add the following methods to EmbeddedDriver:

public   static  void      shutdownDatabase
(
    String  databaseName,
    char[]  dboName,
    char[]  dboPassword,
    Properties  attributes
)
    throws SQLException

    where

        databaseName is the name which you state on a connection url
        between the "jdbc:derby:" prefix and the ";" which marks
        the start of the optional attributes. So for instance:

            myDB
            memory:myMemoryDB

        props is the set of additional attributes and properties
        currently passed on connection urls and needed for
        security-related behaviors like authentication and ssl

public   static  void      shutdownEngine
(
    char[]  sysadminName,
    char[]  sysadminPassword,
    Properties  attributes,
    boolean     unloadDerbyClasses
)
    throws SQLException


We could add the following similar methods to ClientDriver40:

public   static  void      shutdownDatabase
(
    String  hostName,
    int         portNumber,
    String  databaseName,
    char[]  dboName,
    char[]  dboPassword,
    Properties  attributes
)
    throws SQLException


public   static  void      shutdownEngine
(
    String  hostName,
    int         portNumber,
    char[]  sysadminName,
    char[]  sysadminPassword,
    Properties  attributes,
    boolean     unloadDerbyClasses
)
    throws SQLException


All of these methods would return only after they completed their work. They would NOT raise an exception if they succeeded.

We would want to add corresponding commands to ij:

shutdown database $databaseName [ $attributeName=$attributeValue ]*

shutdown engine [ unload ] [ $attributeName=$attributeValue ]*

    where distinguished attribute names include:

        user
        password
        host
        port

                
> Provide an alternative means to shut down a database other than using  getConnection()
> --------------------------------------------------------------------------------------
>
>                 Key: DERBY-586
>                 URL: https://issues.apache.org/jira/browse/DERBY-586
>             Project: Derby
>          Issue Type: Improvement
>          Components: Services
>            Reporter: Lance Andersen
>            Priority: Minor
>
> It would be nice to provide an alternative mechanism to shutdown a database other than calling getConnection() and having an Exception thrown.

--
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