db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jean T. Anderson" <...@bristowhill.com>
Subject Re: Derby Shutdown
Date Sat, 01 Jul 2006 14:39:26 GMT
Daniel Morton wrote:
> Hello All...
> I was just wondering, why does Derby throw an
> SQLException when it shuts down, ie:
> DriverManager.getConnection("jdbc:derby:;shutdown=true"); 

A clean shutdown always throws SQL exception XJ015. While disconcerting,
it's harmless.  Here's the explanation from [1]:

> The issue is that standard JDBC getConnection() method calls (either
> DriverManager or DataSource) are used to push the shutdown request to
> Derby. A successful return from these methods would require a Connection
> object to be returned. It seemed strange to return a connection object
> to a database or system that was no longer active, what state would the
> Connection be in, closed? So the decision was made to throw an
> exception, which I think matches spirit of the JDBC spec. (Null as a
> return is not supported by the spec).
> The use of the standard JDBC mechanisms to push the shutdown request
> means that the request can be passed to Derby by any networked JDBC
> driver (e.g. DB2 universal driver, RmiJDBC, Weblogic's old Tengah
> driver) as well as embedded.
> Any alternate solutions are welcome!

I hope this helps.




View raw message