db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kristian Waagan <kristian.waa...@oracle.com>
Subject Re: Shutting down a database that is already shut down
Date Mon, 02 Aug 2010 07:51:10 GMT
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?


> Thanks,
> David
> --
> David W. Van Couvering
> http://www.linkedin.com/in/davidvc
> http://davidvancouvering.blogspot.com
> http://twitter.com/dcouvering

View raw message