OK, thanks.  I'll work to ensure that I only shut down a database that is currently up, just to keep my life simple and the log empty of kruft.

David

On Mon, Aug 2, 2010 at 12:51 AM, Kristian Waagan <kristian.waagan@oracle.com> wrote:
On Fri, Jul 30, 2010 at 02:30:34PM -0700, David Van Couvering wrote:
> Do I have to worry about ensuring that a database is running before I try to
> shut it down, or is it OK to get a connection with URL ";shutdown=true" on a
> database that's not booted.
>
> If I were to do that, does it boot the database and then shut it down again, or
> does it do nothing?

Hi David,

Derby won't boot the database, but you will get a database not found
exception. The exception may also be written to derby.log, which casues
the file to grow a lot faster if you issue a lot of shutdown requests
for non-booted databases.

You get the exception because the getConnection call must either
return a valid connection or throw an exception. Since we haven't shut
down the database (it wasn't booted), we cannot throw an exception
saying we did so. Getting database not found seems a bit odd too, but
maybe Derby currently has to boot a database to confirm that it exists?


Regards,
--
Kristian



--
David W. Van Couvering

http://www.linkedin.com/in/davidvc
http://davidvancouvering.blogspot.com
http://twitter.com/dcouvering