db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kathey Marsden (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (DERBY-5994) Different SQL State is returned when executing "shutdown=true" - locally or remotely
Date Wed, 14 Nov 2012 17:04:12 GMT

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

Kathey Marsden commented on DERBY-5994:

Just to throw in some information, which I don't think solves your particular problem but
may promote understanding:

Here is the SQL State reference

The SQL State 08004 is I believe a SQL Standard State that the data source rejected establishment
of connection and we have multiple messages that map to this state. Some with a nested exception
but I think that is available only in embedded for this error.

There is a related, perhaps the same issue as this one:

Misleading XJ004 exception when shutting down a database that is already shutdown. 

> Different SQL State is returned when executing "shutdown=true" - locally or remotely
> ------------------------------------------------------------------------------------
>                 Key: DERBY-5994
>                 URL: https://issues.apache.org/jira/browse/DERBY-5994
>             Project: Derby
>          Issue Type: Bug
>          Components: JDBC, Network Client, Network Server, Replication
>    Affects Versions:
>         Environment: Derby Embedded Network Server - Not specific to operating systems,
software platforms or hardware specifications.
>            Reporter: Oskar Zinger
> Different SQL State is returned when executing "shutdown=true" Derby URL attribute while
executing the shutdown Database connection locally or remotely.
> Here is some background information:
> - Using the embedded Derby Network Server deployment (derbynet.jar)
> - Using the JDBC Derby Client (derbyclient.jar)
> - Using the Derby Engine (derby.jar)
> When executing the following - if database has not been booted yet (or already shutdown)
- the SQL State Code is "XJ004":
>   DriverManager.getConnection("jdbc:derby:<database_name>;shutdown=true;deregister=false",
user, pass);
> When executing the following - if database has not been booted yet (or already shutdown)
- the SQL State Code is "08004":
>   DriverManager.getConnection("jdbc:derby://<host>:<port>/<database_name>;shutdown=true;deregister=false",
user, pass);
> The SQL State Code of "08004" usually is returned with an SQL Exception if "User Authentication
is Invalid" for example username and / or password is incorrect.
> Here is the error message: 
> Error Code: '40000', SQL State Code: '08004' and Exception: 'java.sql.SQLNonTransientConnectionException:
The connection was refused because the database <database_name>;shutdown=true;deregister=false
was not found.'
> Separately, the error message "database was not found" is actually misleading because
the database actually does exist and it just has not been been booted yet, or it has already
been shutdown. The Derby Network Server has not been shutdown, only the database and it is
possible to check if the database exists on the file system.
> The reason why this is important is because when using Derby Replication, when replication
is started - the databases must be identical and in sync, so the database must be shutdown
cleanly, copied over, and replication will be started. Since the Salve Derby must start before
Master Derby, it is required to be able to remotely shutdown the Master Derby database from
the Slave Derby instance (host).

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

View raw message